Guest User

hide console window

a guest
May 4th, 2013
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <windows.h>
  3.  
  4. typedef HWND (WINAPI *GETCONSOLEWINDOW)(void);  
  5. GETCONSOLEWINDOW GetConsoleWindow;
  6.  
  7.  
  8. int main()
  9. {
  10.     HWND hwndClosole;
  11.     HMODULE hmod = GetModuleHandleA("KERNEL32.DLL");  
  12.     GetConsoleWindow =(GETCONSOLEWINDOW) GetProcAddress(hmod, "GetConsoleWindow");
  13.    
  14.    
  15.     hwndClosole = GetConsoleWindow();
  16.     ShowWindow(hwndClosole,SW_HIDE);
  17.     Sleep(3000);
  18.     ShowWindow(hwndClosole,SW_RESTORE);
  19.     while(1);  
  20.  
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment