SendMessage for the new help file of AutoHotkey

Get help with using AutoHotkey and its commands and hotkeys
ozzii
Posts: 325
Joined: 30 Oct 2013, 06:04

SendMessage for the new help file of AutoHotkey

24 Jan 2018, 02:52

Hi,

I can't find (and TBH I don't know how :oops: ) the SendMessage for clicking the index part of the new help file of AutoHotkey.

Can someone help me ?
User avatar
derz00
Posts: 497
Joined: 02 Feb 2016, 17:54
GitHub: derz00
Location: Middle of the round cube

Re: SendMessage for the new help file of AutoHotkey

24 Jan 2018, 12:19

@ozzii, you're best off to use the keypress Alt + n. That selects the index tab.
try it and see
...
User avatar
jeeswg
Posts: 6818
Joined: 19 Dec 2016, 01:58
Location: UK

Re: SendMessage for the new help file of AutoHotkey

24 Jan 2018, 12:30

This used to work on old versions of the AutoHotkey Help chm.

Code: Select all

q:: ;AutoHotkey Help (old versions) - focus Index tab
PostMessage, 0x111, 6008,,, A ;WM_COMMAND := 0x111
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
ozzii
Posts: 325
Joined: 30 Oct 2013, 06:04

Re: SendMessage for the new help file of AutoHotkey

25 Jan 2018, 03:47

I think I will use the Alt+n..
Didn't think it worked because when I select the option from the menu (without the shortcut), nothing happened.

Thanks all.


EDIT :
Even this simple thing doesn't work :

Code: Select all

		WinWait, AutoHotkey Help
		WinActivate, AutoHotkey Help
		WinWaitActive, AutoHotkey Help
		sleep, 200
		WinMaximize , AutoHotkey Help
		sleep, 1000
		Send, {Alt}n
		sleep, 500
But the alt+n work manually :wtf:
User avatar
jeeswg
Posts: 6818
Joined: 19 Dec 2016, 01:58
Location: UK

Re: SendMessage for the new help file of AutoHotkey

25 Jan 2018, 05:21

- chm files use Internet Explorer_Server controls, and this script can interact with them on the new versions of AutoHotkey Help to focus the Index tab.
- This also works to focus the Index tab on the active Internet Explorer tab.
- It requires the WBGet function, which I have provided a link to.

Code: Select all

;WBGet function - AutoHotkey Community
;https://autohotkey.com/boards/viewtopic.php?f=6&t=39869

q:: ;AutoHotkey Help (new versions, v1.1.27+, v2.0-a082+) - focus Index tab
;tested on AutoHotkey Help v1.1.27 and v2.0-a083
;works on v2.0-a082 if you comment out the 'if' line

WinGet, hWnd, ID, A
oWB := WBGet("ahk_id " hWnd)
oElt := oWB.document.getElementsByTagName("li")[1]
if (oElt.innerText = "Index")
	oElt.click()
oWB := oElt := ""
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
ozzii
Posts: 325
Joined: 30 Oct 2013, 06:04

Re: SendMessage for the new help file of AutoHotkey

25 Jan 2018, 05:41

This is working, thanks a lot jeeswg
lexikos
Posts: 6652
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: SendMessage for the new help file of AutoHotkey

25 Jan 2018, 18:04

When you tap (press and release) Alt and then tap n, does it work? Of course it doesn't, so neither will Send {Alt}n.

I use Send !n^a.
WinGet, hWnd, ID, A
oWB := WBGet("ahk_id " hWnd)
Why wouldn't you just pass "A" directly? oWB := WBGet("A").
User avatar
jeeswg
Posts: 6818
Joined: 19 Dec 2016, 01:58
Location: UK

Re: SendMessage for the new help file of AutoHotkey

25 Jan 2018, 18:42

- It's likely that they have either already retrieved the hWnd, or want to use it again later.
- Modifying the script from hWnd to A is easier than from A to hWnd.
- Btw the WBGet function is unusual/misleading in that it uses only 1 of the 4 'WWEE' parameters. I would make it take an hCtl e.g.
hCtl := ControlGetHwnd("Internet Explorer_Server1", "A")
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask For Help”

Who is online

Users browsing this forum: BreezeB, jemmm, marcefw, Odlanir, RickC and 221 guests