Discussion:
What's the purpose of dwHotkey in SHELLEXECUTEINFO?
(too old to reply)
JJ
2021-11-06 10:45:05 UTC
Permalink
The documentation states that it's for associating a hotkey to the
(launched) application. Presumably, for activating the application window,
as stated in the WM_SETHOTKEY documentation.

But the given hotkey never work and has no effect even though the
SEE_MASK_HOTKEY flag is already specified. I've already tried it by running
executing NOTEPAD.EXE with VK_F12 hotkey and with/without the
HOTKEYF_CONTROL flag.

Is that what dwHotkey is supposed to be for? Cause I've never seen an
article covering such feature. i.e. a hotkey to activate the window of an
executed (specific) application. Or the application itself - just like the
hotkey field of a program shortcut file. Also, the executor application
never does receive any SC_HOTKEY code from a WM_SYSCOMMAND window message -
assuming that the dwHotkey is a shortcut for the RegisterHotkey() API
function.

If it's not, what's the purpose of it, and how to use it? Or is it that,
it's applicable for the desktop process only?
R.Wieser
2021-11-06 19:20:59 UTC
Permalink
JJ,
Post by JJ
But the given hotkey never work and has no effect even though the
SEE_MASK_HOTKEY flag is already specified. I've already tried it by
running executing NOTEPAD.EXE with VK_F12 hotkey and with/without the
HOTKEYF_CONTROL flag.
mov [ebx].SEI_dwHotKey,VK_F8
or [ebx].SEI_fMask,SEE_MASK_HOTKEY

I've just added the above to a bit of code using ShellExecuteEx to open
notepad under XPsp3. After I hid or iconified notepad pressing F8 brought
it back up (at the front and focussed).

IOW, I've got no idea why yours doesn't work.

Regards,
Rudy Wieser
JJ
2021-11-08 06:12:09 UTC
Permalink
Post by R.Wieser
JJ,
Post by JJ
But the given hotkey never work and has no effect even though the
SEE_MASK_HOTKEY flag is already specified. I've already tried it by
running executing NOTEPAD.EXE with VK_F12 hotkey and with/without the
HOTKEYF_CONTROL flag.
mov [ebx].SEI_dwHotKey,VK_F8
or [ebx].SEI_fMask,SEE_MASK_HOTKEY
I've just added the above to a bit of code using ShellExecuteEx to open
notepad under XPsp3. After I hid or iconified notepad pressing F8 brought
it back up (at the front and focussed).
IOW, I've got no idea why yours doesn't work.
Regards,
Rudy Wieser
*&^%$#@!!! Stupid Microsoft!

Apparently, they broke it since NT6 (Vista) and up to the latest Windows 10
build. Tested on clean OS installations in VM. I'm using Win7, so it's the
reason it doesn't work.

It still works fine in Windows 2003 (i.e. NT5.2), Windows XP, and likely
older versions too.

I'm pretty sure it's still broken in the upcoming Windows 11 release build.
I do have the beta builds in VM, but don't bother to test them.

Thanks for the input, BTW.
R.Wieser
2021-11-08 07:04:45 UTC
Permalink
JJ,
Post by JJ
Apparently, they broke it since NT6 (Vista) and up to the latest
Windows 10 build. Tested on clean OS installations in VM. I'm
using Win7, so it's the reason it doesn't work.
I just checked the docs.microsoft.com for the SHELLEXECUTEINFO structure and
they do not even bother to mention it, even when that breakage is 15 years
old. Stupid Microsoft indeed. :-(
Post by JJ
Thanks for the input, BTW.
You're welcome. And thanks for the feedback.

Regards,
Rudy Wieser

Loading...