metalx1000

GCC Windows Hide Minimize Maximize Windows

Dec 21st, 2017
822
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include <windows.h>
  2. #include <string>
  3. using std::string;
  4. #include <unistd.h>
  5.  
  6. int main(){
  7.     //sleep 5 seconds
  8.     int s=5;
  9.     sleep(5);
  10.    
  11.     //get focused window
  12.     HWND hWnd = GetForegroundWindow();
  13.    
  14.     //hide focused window
  15.     ShowWindow( hWnd, SW_HIDE );
  16.     //ShowWindow( hWnd, SW_HIDE );
  17.    
  18.     //sleep 5 seconds
  19.     sleep(5);
  20.    
  21.     //show hiden window
  22.     ShowWindow( hWnd, SW_SHOW );
  23.    
  24.     //sleep 2 seconds
  25.     sleep(2);
  26.    
  27.     //minmize window
  28.     ShowWindow( hWnd, SW_MINIMIZE );
  29.    
  30.     //sleep 2 seconds
  31.     sleep(2);
  32.    
  33.     //maximize window
  34.     ShowWindow( hWnd, SW_MAXIMIZE );
  35.    
  36.     //sleep 2 seconds
  37.     sleep(2);
  38.    
  39.     //restore window
  40.     ShowWindow( hWnd, SW_RESTORE );
  41.  
  42.     return 0;
  43. }
Add Comment
Please, Sign In to add comment