#include <windows.h> int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { char fname[] = "D:/node.exe run"; char cfname[] = "D:/node"; STARTUPINFO cif; ZeroMemory(&cif, sizeof(STARTUPINFO)); PROCESS_INFORMATION pi; CreateProcessA(NULL, fname, NULL, NULL, FALSE, CREATE_NEW_PROCESS_GROUP, NULL, cfname, &cif, &pi); } 

When launched in this way, the standard window of the node pops up, which is extremely undesirable ...

  • one
    Try this: CreateProcessA (NULL, fname, NULL, NULL, FALSE, CREATE_NEW_PROCESS_GROUP | CREATE_NO_WINDOW , NULL, cfname, & cif, & pi); - Embedder
  • @Embedder, thank you, it worked - Kopkan
  • Design and mark as an answer, please, so that you can find it in the search. - user1056837

1 answer 1

To start a child console process without creating an additional window, you can use the CreateProcessA / CreateProcessW function, in which you set the dwCreationFlags parameter to CREATE_NO_WINDOW (or its combination with other necessary flags). Like this (code from the question):

 CreateProcessA(NULL, fname, NULL, NULL, FALSE, CREATE_NEW_PROCESS_GROUP | CREATE_NO_WINDOW, NULL, cfname, &cif, &pi); 

A full description of the function and examples of its use can be found in MSDN .