I want to hide my application window then capture the screen. I tried the code below but the screen shot capture parts of my application window. How to make my application wait till its window is completely hidden?
Here is the code that does not work:
IsHide = AfxGetMainWnd()->SetWindowPos(AfxGetMainWnd(),0,0,0,0,SWP_HIDEWINDOW);
AfxGetMainWnd()->UpdateWindow(); //Make sure it is hidden
// Wait until everybody repaints themselves
while (PeekMessage(&msg,NULL,0,0,PM_REMOVE) != 0)
keybd_event(VK_SNAPSHOT,1,0,0); //full screen