Help and Questions about RegisterWindowMessage Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Larkal
Posts: 21
Joined: 08 Mar 2019, 00:36

Help and Questions about RegisterWindowMessage

12 Jul 2020, 00:03

I'm playing around with SKAN's RegisterWindowMessage Shellhook.
(https://autohotkey.com/board/topic/80644-how-to-hook-on-to-shell-to-receive-its-messages/)

From what I understand the ShellMessage function should only be receiving 2 parameters (wParam and lParam). However, when I use it it's receiving 4.
(Example values)
param3 = 49192
param4 = 12327652

Param3 seems to remain the same (though I haven't rebooted to see if it changes.)
Param4 changes with each run of the script.
What are these 2 extra parameters and how can I go about figuring out the meaning of their values?

Code: Select all

myGui := Gui.New("+LastFound")
hWnd := WinExist()
DllCall("RegisterShellHookWindow", "UInt", Hwnd)
MsgNum := DllCall("RegisterWindowMessage", "Str","SHELLHOOK")
OnMessage(MsgNum, "ShellMessage")

ShellMessage(wParam, lParam, param3, param4)
{
	if (!lParam || !WinExist("ahk_id" lParam)) {
		Return
	}

    winT := WinGetTitle("ahk_id " lParam)

    If (wParam=4 || wParam=32772) {
        ToolTip "winT : " winT "`n[1] lParam: " lParam "`n[2] wParam: " wParam
	        .	"`n[3] param3: " param3 "`n[4] param4: " param4
	}
}
Last edited by BoBo on 12 Jul 2020, 00:58, edited 1 time in total.
Reason: Moved to 'Ask for Help' v2.

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: Google [Bot], lirouxtm, w_i_k_i_d and 41 guests