隱藏console視窗
會閃一下,沒辦法一開始就隱藏
#include <windows.h>
void HideWindow(void)
{
const int BUFSIZE = 1024;
HWND m_hWnd;
char *pszTitle;
pszTitle = (char*)calloc( BUFSIZE, sizeof(char) );
GetConsoleTitle( pszTitle, BUFSIZE );
m_hWnd = FindWindow( "ConsoleWindowClass", pszTitle );
ShowWindow( m_hWnd, SW_HIDE );
}
int main()
{
HideWindow();
/* Someing you want to do */
return 0;
}
沒有留言:
張貼留言