tags:

views:

63

answers:

1

I want to use global hotkeys (one that works outside of the app) and i found this

It looks like i need to initialize it using a System.Windows.Window. But how do i get one?

+1  A: 

System.Windows.Window is a WPF Window.

If you are doing this with Windows Forms or no form, you can setup a low-level keyboard hook, and trap your hotkey that way.

Reed Copsey
Please don't do this. Keyboard hooks are a fairly unfriendly way to solve a problem for which windows already has a solution.
John Knoeller
Keyboard hooks are the only real way to handle this for supporting hotkeys that work "outside of the app", which the OP requested. The other solutions require a window handle, typically, which means a form needs to exist, and most only work if the application is active.
Reed Copsey
OMG sorry, i accidentally clicked down instead of up. I couldnt change it until i edit your answer. So i edit some whitespace. +1
acidzombie24
@acidzombie24: No problem. Thanks for the "correction" :)
Reed Copsey