News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

RegisterHotKey help

Started by Magnum, December 10, 2011, 06:52:20 PM

Previous topic - Next topic

Magnum

Since RegisterHotKey requires a two key combination, is there a way to make it work
with just a single Ctrl or Spacebar press ?
Have a great day,
                         Andy

jj2007

Sure.
SWITCH uMsg
CASE WM_DESTROY
invoke UnregisterHotKey, 0, 127
invoke PostQuitMessage, NULL

CASE WM_HOTKEY
invoke MessageBox, rv(GetForegroundWindow), chr$("Ho ho HOT"), chr$("Ciao:"), MB_OK

CASE WM_CREATE
invoke RegisterHotKey, hWnd, 127, 0, VK_F2


Magnum

Thanks gentlemen.

This is my final version.

It combines two separate programs into one.  :U
Have a great day,
                         Andy