c# - How do I capture PrintScreen in a Hot Key Control in Windows Forms? -
I am working on a screen capture program and I want to allow users to set custom hotkeys.
I have tried to use the Windows msctls_hotkey32
control class in custom control using the CreateParams
. However, it does not accept PrintScr as the key, which is not acceptable due to the nature of my program.
I have tried to create a custom control that however ProcessCmdKey
, The function is never called for the print-screen key, and it does not contain keys associated with the key (like Ctrl + PrintScr only me ControlKey Gives, control
).
After some research I came to know that only one WM_KEYUP
message has been sent for the print screen, but for a hot key control, only the bottom key is acceptable because you have enabled Must enter key combinations
Is there any way to allow me to capture key combinations that contain a print screen? If not, how can I design my user interface to allow such key combinations without using a big dropdown?
Try
Protected Override Bulk ProcessesEntErgS (Ref message messages) {If ((keys (int) msg.WParam) == key print screen) {ScreenCapture (Environment.GetFolderPath (Environment. SpecialFolder.Desktop)); } Return Base ProcessAyventAgres (Riff Message); }
More information
Update:
Protected Override Bull Processed Event Message {Keyage's Data = (Keys) Msg .Parama | ModifierKeys; If (keydata == (Keys.PrintScreen | Keys.Control)) {ScreenCapture (Environment.GetFolderPath (Environment.SpecialFolder.Desktop)); } Return Base ProcessAyventAgres (Riff Message); }
Comments
Post a Comment