Hotkey Activates Minimized Window

  • Thread starter Thread starter Larry(LJL269)
  • Start date Start date
L

Larry(LJL269)

I 1st open F:\My Documents\MyBank+Bills\ with hotkey
CTL+ALT+B & then open subfolder
F:\My Documents\Favorites\MyBank+Bills\CCards and min
it. When I type CTL+ALT+B again CCards window is
activated. If I kill CCards window, CTL+ALT+B reverts
back to F:\My Documents\MyBank+Bills\.

This also happens on at least 1 other CTL+ALT hotkey.

Your help is MUCH appreciated.
Thanks- bye- Larry

Any advise is my attempt to contribute more than I have received but I can only assure you that it works on my PC. GOOD LUCK.
 
Greetings & thank you David for your response.

Excellent document 4 hotkey freaks like me with the
added benefit of 'List user set hotkeys' link whch
listed those I defined. Does this use any of work with
bat file, etc u did b4?

I read Hotkeys section but saw nothing that would
explain my problem particularily since some folders
that open from hotkey do NOT open a lower level window
navigated to when activated a 2nd time.So the behavior
is not consistent.

Comments/suggestions/corrections appreciated.
Thanks- bye- Larry


|See attached document that explains it and lists all hotkeys.

Any advise is my attempt to contribute more than I have received but I can only assure you that it works on my PC. GOOD LUCK.
 
These are the programming docs.


Platform SDK: Windows User Interface

WM_SETHOTKEY
An application sends a WM_SETHOTKEY message to a window to associate a hot key with the window. When the user presses the hot key, the system activates the window.

To send this message, call the SendMessage function with the following parameters.

SendMessage(
(HWND) hWnd, // handle to destination window
WM_SETHOTKEY, // message to send
(WPARAM) wParam, // virtual-key code and modifiers
(LPARAM) lParam // not used; must be zero
);Parameters
wParam
The low-order word specifies the virtual-key code to associate with the window.
The high-order word can be one or more of the following values. Value Meaning
HOTKEYF_ALT ALT key
HOTKEYF_CONTROL CTRL key
HOTKEYF_EXT Extended key
HOTKEYF_SHIFT SHIFT key



Setting wParam to NULL removes the hot key associated with a window.

lParam
This parameter is not used.
Return Values
The return value is one of the following.

Value Meaning
-1 The function is unsuccessful-the hot key is invalid.
0 The function is unsuccessful-the window is invalid.
1 The function is successful, and no other window has the same hot key.
2 The function is successful, but another window already has the same hot key.


Remarks
A hot key cannot be associated with a child window.

VK_ESCAPE, VK_SPACE, and VK_TAB are invalid hot keys.

When the user presses the hot key, the system generates a WM_SYSCOMMAND message with wParam equal to SC_HOTKEY and lParam equal to the window's handle. If this message is passed on to DefWindowProc, the system will bring the window's last active popup (if it exists) or the window itself (if there is no popup window) to the foreground.

A window can only have one hot key. If the window already has a hot key associated with it, the new hot key replaces the old one. If more than one window has the same hot key, the window that is activated by the hot key is random.

These hot keys are unrelated to the hot keys set by RegisterHotKey.

Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Winuser.h; include Windows.h.

See Also
Keyboard Input Overview, Keyboard Input Messages, RegisterHotKey, WM_GETHOTKEY, WM_SYSCOMMAND


Platform SDK Release: August 2001 What did you think of this topic?
Let us know. Order a Platform SDK CD Online
(U.S/Canada) (International)



Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Winuser.h; include Windows.h.

See Also
Keyboard Input Overview, Keyboard Input Messages, RegisterHotKey, WM_GETHOTKEY, WM_SYSCOMMAND





Platform SDK: Windows User Interface


RegisterHotKey
The RegisterHotKey function defines a system-wide hot key.

BOOL RegisterHotKey(
HWND hWnd, // handle to window
int id, // hot key identifier
UINT fsModifiers, // key-modifier options
UINT vk // virtual-key code
);Parameters
hWnd
[in] Handle to the window that will receive WM_HOTKEY messages generated by the hot key. If this parameter is NULL, WM_HOTKEY messages are posted to the message queue of the calling thread and must be processed in the message loop.
id
[in] Specifies the identifier of the hot key. No other hot key in the calling thread should have the same identifier. An application must specify a value in the range 0x0000 through 0xBFFF. A shared dynamic-link library (DLL) must specify a value in the range 0xC000 through 0xFFFF (the range returned by the GlobalAddAtom function). To avoid conflicts with hot-key identifiers defined by other shared DLLs, a DLL should use the GlobalAddAtom function to obtain the hot-key identifier.
fsModifiers
[in] Specifies keys that must be pressed in combination with the key specified by the nVirtKey parameter in order to generate the WM_HOTKEY message. The fsModifiers parameter can be a combination of the following values. Value Meaning
MOD_ALT Either ALT key must be held down.
MOD_CONTROL Either CTRL key must be held down.
MOD_SHIFT Either SHIFT key must be held down.
MOD_WIN Either WINDOWS key was held down. These keys are labeled with the Microsoft Windows logo.


vk
[in] Specifies the virtual-key code of the hot key.
Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks
When a key is pressed, the system looks for a match against all hot keys. Upon finding a match, the system posts the WM_HOTKEY message to the message queue of the thread that registered the hot key. This message is posted to the beginning of the queue so it is removed by the next iteration of the message loop.

This function cannot associate a hot key with a window created by another thread.

RegisterHotKey fails if the keystrokes specified for the hot key have already been registered by another hot key.

If the window identified by the hWnd parameter already registered a hot key with the same identifier as that specified by the id parameter, the new values for the fsModifiers and vk parameters replace the previously specified values for these parameters.

Windows NT4 and Windows 2000/XP: The F12 key is reserved for use by the debugger at all times, so it should not be registered as a hot key. Even when you are not debugging an application, F12 is reserved in case a kernel-mode debugger or a just-in-time debugger is resident.

Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Winuser.h; include Windows.h.
Library: Use User32.lib.

See Also
Keyboard Input Overview, Keyboard Input Functions, GlobalAddAtom, UnregisterHotKey, WM_HOTKEY


Platform SDK Release: August 2001 What did you think of this topic?
Let us know. Order a Platform SDK CD Online
(U.S/Canada) (International)



Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Winuser.h; include Windows.h.
Library: Use User32.lib.

See Also
Keyboard Input Overview, Keyboard Input Functions, GlobalAddAtom, UnregisterHotKey, WM_HOTKEY
 
Back
Top