Since your program doesn't have the focus when you want to save the screen. You might want to look into using the RegisterHotKey function to register a hotkey to be used to save the screen. You could then use the code posted by Hack above in the callback function to save the image.