I'm doing something slightly different but easier and I'm hoping for some help.
I put in all my pushpins manually so what I'm looking for is a hotkey sequence that places a pushpin where my cursor currently is without having to mouse over to the "create pushpin" button (Button78).
So the cursor will always be in the Map Control window when I press the sequence (I hope). I'll worry about error handling later.
It looks like all I need is ControlFocus and ControlClick plus the coordinates of the mouse (maybe).
However I can't seem to get the ControlFocus and ControlClick to work. Nothing happens when I run the script. It's a stupid newbie question but maybe someone will have pity on me and enlighten me on how to get it working. Here's what I have to try and get the focus and the click:
ControlFocus, Button78, "Create Pushpin", "AfxWnd702"
Sleep 100
ControlClick, Button78, "Create Pushpin", "AfxWnd702"
******************
This will do what I want it to do but I would prefer it not be dependent on the coordinates and not move the mouse if possible (I'm using 1024x768 with S&T maximized and a taskbar that is double the normal height) (62, 695 is the X,Y of the create pushpin button).
^LButton::
BlockInput, SendAndMouse
SetTitleMatchMode, 2
SetTitleMatchMode, Slow
WinWait, Microsoft Streets & Trips,
IfWinNotActive, Microsoft Streets & Trips, , WinActivate, Microsoft Streets & Trips,
WinWaitActive, Microsoft Streets & Trips,
Sleep, 5
MouseGetPos, origx, origy
MouseClick, left, 62, 695
MouseMove, origx, origy
MouseClick, left, origx, origy
Thanks,
Curt