SaphuA
SaphuA

Reputation: 3150

Fullscreen app prevents hotkeys

I've developed a WPF application that registers Hotkeys using com interop and processes them using WndProc.

The hotkeys work perfectly even when the application doesn't have focus. However, they don't work when certain fullscreen appications have focus (games). Is there a way for me to fix this?

Thanks!

Upvotes: 2

Views: 918

Answers (2)

Zach Johnson
Zach Johnson

Reputation: 24232

Even though registered hotkeys are disabled, you might be able to process your hotkeys via a low level keyboard hook. They can be kind of tricky to implement right, but you can look at the AutoHotkey source to see how it handles hotkeys in a low level keyboard hook.

This is a good tutorial on setting up a low level keyboard hook in C#.

Upvotes: 1

Chris Taylor
Chris Taylor

Reputation: 53719

The disabling of hotkeys is by design and as far as I know not much you can do about it.

Full screen DirectX applications (typically games) will call IDirectDraw::SetCooperativeLevel with the DDSCL_FULLSCREEN and DDSCL_EXCLUSIVE flags which results in, amongst other things, the registered hotkeys being disabled.

Upvotes: 3

Related Questions