Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #include <string>
- using std::string;
- #include <unistd.h>
- int main(){
- //sleep 5 seconds
- int s=5;
- sleep(5);
- //get focused window
- HWND hWnd = GetForegroundWindow();
- //hide focused window
- ShowWindow( hWnd, SW_HIDE );
- //ShowWindow( hWnd, SW_HIDE );
- //sleep 5 seconds
- sleep(5);
- //show hiden window
- ShowWindow( hWnd, SW_SHOW );
- //sleep 2 seconds
- sleep(2);
- //minmize window
- ShowWindow( hWnd, SW_MINIMIZE );
- //sleep 2 seconds
- sleep(2);
- //maximize window
- ShowWindow( hWnd, SW_MAXIMIZE );
- //sleep 2 seconds
- sleep(2);
- //restore window
- ShowWindow( hWnd, SW_RESTORE );
- return 0;
- }
Add Comment
Please, Sign In to add comment