问题
I've build a WPF application and want to add global hotkey support. I want to be able to execute a method in my application from anywhere in windows, even when my application is minimized or running in tray. For example, execute the method with ctrl + alt + t.
Is this possible in WPF, and if so, how?
回答1:
You need to take a look at RegisterHotKey in user32.dll. Here's a good example at pinvoke.net: http://www.pinvoke.net/default.aspx/user32/RegisterHotKey.html
来源:https://stackoverflow.com/questions/4489118/global-hotkeys-in-wpf