Subroutine GrabScreen uses the GetDesktopWindow API function to get the hWnd of the desktop window. It uses GetDC to get a device context for that window and calls GetWindowRect to see how big the desktop window is.

It then uses StretchBlt to copy the desktop window's image onto the hidden PictureBox picHidden. It uses ReleaseDC to free the desktop's device context and finally saves the image in picHidden into a bitmap file.