SendMessage to a Toolbar

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
blad4
Posts: 315
Joined: 07 Oct 2015, 11:06

SendMessage to a Toolbar

06 Jul 2019, 11:41

Below is the windows spy information when a button in the toolbar has been pressed. I have tried using all variations of

Code: Select all

SendMessage, 0x1330, 0, 0, Sierra
Etc, ahk_class, classnn and ahk_exe but with no luck. Is something wrong?
Attachments
Untitled.png
Untitled.png (34.89 KiB) Viewed 1175 times
wolf_II
Posts: 2688
Joined: 08 Feb 2015, 20:55

Re: SendMessage to a Toolbar

06 Jul 2019, 12:08

try

Code: Select all

SendMessage, 0x1330, 0, 0,, Sierra
changes: empty control parameter, Sierra is now WinTitle.

Most likely, you need to start again trying to find the correct WinTitle, or use LastFoundWindow
ahk_exe would be a good candidate

Better yet: find the correct control as well. Good Luck :)
blad4
Posts: 315
Joined: 07 Oct 2015, 11:06

Re: SendMessage to a Toolbar

06 Jul 2019, 12:26

Thanks Wolf.. attached is the control I found while clicked on the correct button and using ControlGetFocus, same as in windows spy right? I have tried using it too with no luck, the extra comma also did not work. So strange because original code worked normal on last system (win8)
Attachments
Untitled.png
Untitled.png (2.92 KiB) Viewed 1153 times
wolf_II
Posts: 2688
Joined: 08 Feb 2015, 20:55

Re: SendMessage to a Toolbar

06 Jul 2019, 12:41

more explicit: Sendmessage will interpret all the parameters as documented. Your original script did not have a WinTitle parameter.
adding a comma there, has shifted Sierra to be interpreted as the WinTitle parameter. I hope to have made that a bit more clear.
Now we know the control of the correct window,

Try

Code: Select all

SendMessage, 0x1330, 0, 0, Afx:02020202:2b1, ahk_exe SierraChart_64.exe
I may have left the wrong digits, use correct ones.

Also: controls with obscure ClassNames, like here, could change every time SierraChart_64.exe is started. Be aware.
blad4
Posts: 315
Joined: 07 Oct 2015, 11:06

Re: SendMessage to a Toolbar

06 Jul 2019, 13:01

Thanks again, but still no luck. The problem is that the control Afx:0000000140000000:2b1 does not differentiate between child windows or toolbars in the main program. The real control should be something like 'SysToolbar331', but spy cannot locate this on this system for some reason?
wolf_II
Posts: 2688
Joined: 08 Feb 2015, 20:55

Re: SendMessage to a Toolbar

06 Jul 2019, 13:08

I see. But this is above and beyond me. I can only imagine some acc library might help.
Forum user Jeeswg and many others have more experience using the acc library. Wait for better advice, I guess.
Sorry, and good luck again. :thumbup:
blad4
Posts: 315
Joined: 07 Oct 2015, 11:06

Re: SendMessage to a Toolbar

06 Jul 2019, 13:22

No problem bro thanks!
blad4
Posts: 315
Joined: 07 Oct 2015, 11:06

Re: SendMessage to a Toolbar

06 Jul 2019, 13:25

Note with 'follow mouse' checked I get

ClassNN: Afx:0000000140000000:28:0000000000010003:0000000000100059:00000000000000001

But still no joy

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Marium0505 and 338 guests