Since RegisterHotKey requires a two key combination, is there a way to make it work
with just a single Ctrl or Spacebar press ?
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
Or use keybd_event
http://www.masm32.com/board/index.php?topic=15797.0
Thanks gentlemen.
This is my final version.
It combines two separate programs into one. :U