RegisterHotKey not working with invisible forms (c#)
问题 I'm trying to put an icon in the system tray and then give it a global keyboard shortcut to carry out a function. I'm using RegisterHotKey to set the global keyboard shortcut, and it works if the main form associated with the icon is visible. But if the form is invisible then the WndProc method is never invoked. Any ideas? Edit: What I mean by "hidden" is that the following is added to the main form: protected override void OnLoad(EventArgs e) { hotKey = new GlobalHotkey(GlobalHotkey.WIN,