Windows Messages
-
How would it be possible to send a "Print Screen" keydown message or whatever? Which message should I send with which params (if possible) Thanks a lot ~Michael
You could manually send a WM_KEYDOWN and a WM_KEYUP message, but it's a bit tricky setting up all the flags and what have you. A better way is to use a function for that specific purpose, keybd_event. Look it up in MSDN. Use it something like keybd_event(VK_PRINTSCREEN, ...); If you are trying to simulate a printscreen to do a screen capture and put it onto the clipbopard, a better way is to call GetDc(NULL) to get the DC for the desktop, then grab the bitmap out of the DC and slap it on the clipboard.
-
You could manually send a WM_KEYDOWN and a WM_KEYUP message, but it's a bit tricky setting up all the flags and what have you. A better way is to use a function for that specific purpose, keybd_event. Look it up in MSDN. Use it something like keybd_event(VK_PRINTSCREEN, ...); If you are trying to simulate a printscreen to do a screen capture and put it onto the clipbopard, a better way is to call GetDc(NULL) to get the DC for the desktop, then grab the bitmap out of the DC and slap it on the clipboard.
-
Thanks a lot, just a little more question about it. I want to simulate that printscreen key in a specific window that is minimized... I've tried adding ' :: ' in front of the keybd_event function, however it still does not take any HWND parameter....
-
Found it!!! Thanks a lot man, without that keybd_event function I couldn't have guessed it. Thanks!! ~Michael