Shell hook handling (not really a bug)

Report problems with documented functionality
Roel
Posts: 12
Joined: 27 Oct 2014, 16:40
Contact:

Shell hook handling (not really a bug)

21 Dec 2017, 14:39

I and other users who are using a registered shell hook to detect window activation, are finding that we need to test for shell hook code 32772 as well as 4. Some users have been equating 32772 = HSHELL_RUDEAPPACTIVATED but I haven't found any Microsoft documentation of that. At https://msdn.microsoft.com/en-us/librar ... s.85).aspx I do find the interesting statement:
If nCode is less than zero, the hook procedure must pass the message to the CallNextHookEx function without further processing and should return the value returned by CallNextHookEx.
Is AHK taking care of that requirement nicely? Seeing the high bit set (32772 = 4 | 32768) on the return codes is making me suspicious.

Also, on a more minor note that same article names the shell code variable nCode and the variable containing the window handle wParam, which is inconsistent with the variable naming most users are using in their message handlers (wParam, lParam). Again, raises my suspicions that there is some lack of clarity going on here in the AHK-Windows interface.

Anyway, NOT critical stuff, this is all beyond my grade level so please forgive me if I am completely off track here. :oops:
lexikos
Posts: 9593
Joined: 30 Sep 2013, 04:07
Contact:

Re: Shell hook handling (not really a bug)

21 Dec 2017, 15:40

Is AHK taking care of that requirement nicely?
What requirement? AutoHotkey does not use a shell hook. AutoHotkey scripts do not even use this type of shell hook.
Again, raises my suspicions that there is some lack of clarity going on here in the AHK-Windows interface.
Why? The parameter names come directly from Microsoft. You are comparing shell hooks to general message parameters (received with OnMessage). OnMessage is not used with SetWindowsHookEx.

I think you're right about two things; being completely off track, and it not being a bug.
Roel
Posts: 12
Joined: 27 Oct 2014, 16:40
Contact:

Re: Shell hook handling (not really a bug)

21 Dec 2017, 15:54

Jeez, sorry I said anything.
zcooler
Posts: 455
Joined: 11 Jan 2014, 04:59

Re: Shell hook handling (not really a bug)

22 Dec 2017, 18:06

Roel wrote:Jeez, sorry I said anything.
The treatment gets rough cuz what you think is a bug can also be seen as questioning of the AHK developer. If you are sensitive and want to avoid this kind of treatment, I suggest first asking about it in the "Ask For Help" section. After confirmation its a bug then post in this section.
Roel
Posts: 12
Joined: 27 Oct 2014, 16:40
Contact:

Re: Shell hook handling (not really a bug)

22 Dec 2017, 18:42

I am sort of a sensitive type, so I'm gonna stick to "Ask for Help" section for the time being. And, for the record, I certainly didn't mean to be questioning the AHK developer! I have been continually impressed with AHK's robustness, integrity and utility, not to mention the quality of documentation and this forum (where I have indeed been treated very well in the "Ask for Help" section). I >heart< AHK! It was just that I saw the coincidence of Microsoft's warning about "less than zero" and the high bit being set, and wanted to bring it to attention in case there was anything to it, which obviously there wasn't (or, at least not within the boundaries of AHK).
zcooler
Posts: 455
Joined: 11 Jan 2014, 04:59

Re: Shell hook handling (not really a bug)

22 Dec 2017, 19:40

There are other reasons too. The AHK dragons wants to keep the bug section "clean as a whistle", but it is overrunned by the questions/bring it to attention type of cases from new users with nothing but good intentions, which unfortunately deflects attention from the actual bugs and the frustration shows. Taking this into account it is kind of surprising mods doesnt move misplaced topics more often, which is the case on other forums.
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Shell hook handling (not really a bug)

23 Dec 2017, 05:00

Please don't think of it as a rough treatment. Rather than that it's a type of communication that is common among developers.
It treats convying your message as the most important thing. In that way it also leaves out formalities and might sound mean - however please be aware that that that is rarely the intention of the communicator.
Recommends AHK Studio

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 19 guests