Title, how can I hide the console black window when I create a new console application on Windows.
The first method:
:: Setconsoletitle (_t ("test_exe")); HWND hwnd=::findwindow (_t (""), _t ("test_exe"));:: ShowWindow (HWND,SW _hide);
No, try, don't know why the failure ....
Window handle caught, just don't understand why not hide ... ⊙﹏⊙ b Khan
The two methods catch the same handle, the same ShowWindow () function, one can, a not ... ⊙﹏⊙ b Khan, good pit ....
The second type:
Get the class name of the cmd window with Spy + +:
Get the class name of the console window: Consolewindowclass
Ok.
HWND hwnd;hwnd=::findwindow (_t ("consolewindowclass"), NULL);:: ShowWindow (hwnd,sw_hide);
You can hide the console window by calling the FindWindow () function OK from the window class name.
The third type:
Many of these are on the Internet:
#pragma COMMENT (linker, "/subsystem:\" windows\ "/entry:\" Wmaincrtstartup\ ") sets the linker configuration for vs.
Modify the default console property for Windows by setting the link subsystem, and make the main entry address for the program: wmainCRTStartup
(The Unicode character set is wmainCRTStartup, the multibyte character group is mainCRTStartup), and this way you can also achieve
Hides the effect of the console window.