views:

110

answers:

4

I used SPY++ to hook my windows message, but there is no WM_SYSCOMMAND message was sent when I pressed "Windows+D". What message will be sent by Windows when you press "Windows+D"? Thnaks in advance.

A: 

I don't think that this is a Window-Message at all...this is most likely handled by the kernel itself.

Bobby
A: 

"Windows+D" is a hotkey combination.
Perhaps you can catch it as a WM_HOTKEY message.

You can register your own hotkeys, if you want, with the RegisterHotKey function.

Nick D
A: 

Windows+D is a system wide hotkey and is reserved for use by operating system. Hotkeys with MOD_WIN can not be registered by RegisterHotKey API or received by WM_HOTKEY message

Indeera
That is not true, RegisterHotKey can catch Win+? hotkeys just fine.
Anders
Anders, I have tried this on Windows 7 (registering fails and WM_HOTKEY is not fired), Could you confirm your platform.
Indeera
It works on Vista, I have tried it. (Though not with a key combination already in use by the OS.)
Nick
+1  A: 

Your application will not get a window message at all. Win+D is a hotkey registered by Explorer.exe (the shell program that's responsible for showing the taskbar, desktop icons, etc.).

It simply uses RegisterHotKey and it will receive a window message when you press WIN+D and will then take care of the whole show/hide thing.

Note you can register your own WIN+x hotkeys using said function but you're not supposed to and will run into problems - unless you were replacing Explorer.exe or such.

ilmcuts