winapi: CreateProcess but hide the process' window?

前端 未结 4 2053
一向
一向 2020-12-01 07:24

I am using CreateProcess to create a cmd.exe process that is passed a parameter that it executes and quits, this makes command prompt flash up on the screen.

I trie

4条回答
  •  广开言路
    2020-12-01 08:01

    If its just a console app you can also use the CREATE_NO_WINDOW flag as part of the CreateProcess call itself, e.g.

    CreateProcess(NULL, lpszCommandLine, NULL, NULL, FALSE, 
                  CREATE_NO_WINDOW, NULL, NULL, &si, &pi);
    

    Also, see this page for information about environment variables.

提交回复
热议问题