This is the recorded data
(Please ignore second and third images, they are just repetitions. I added them for continuity of message numbers)

followed by

followed by

and finally

Well, you can see that, there are only a few mesages being repeated here.
WM_NCHITTEST,WM_SETCURSOR,WM_MOUSEMOVE - to move the mouse
WM_LBBUTTONDOWN,WM_LBUTTONUP - clicking the mouse
To simulate this in a window , this is my script
+q:: WinSetTitle,GridCal v1.0, ,GRIDCAL1 WinID := WinActive("GRIDCAL1") SetFormat,integer,h HexWinId := WinID ;Post MouseMove Message -- 0x021901AF is the x,y coordinate relative to window,no tscreen coordinates. -- position is 431,537 PostMsg("0x200","0x00000000","0x021901AF",WinID) ;Post MouseActivate Msg -- the WParam has to be true - i think it is 0x00000001 PostMsg("0x21",HexWinId,"0x00000001",WinID) ;Activate App -- the WParam has to be true - i think it is 0x00000001 PostMsg("0x1C","0x00000001","0x00000000",WinID) ;Activate -- here Wparam is HTCLIENT -- I read somewhere that its integer val is 2 PostMsg("0x06","0x00000002","0x00000000",WinID) ;Set Cursor -- hit-test code.is HTCLIENT and mouse mesage ID is 513 PostMsg("0x20",HexWinId,"0x02010001",WinID) ;Button Down -- position is 431,537 PostMsg("0x201","0x00000000","0x021901AF",WinID) ;Button Up -- position is 431,537 PostMsg("0x202","0x00000000","0x021901AF",WinID) Return +w::Reload PostMsg(msg,Wparameter,LParameter,WindowID) { PostMessage,%msg%,%Wparameter%,%LParameter%,,ahk_id %WindowID% Sleep,200 }
Here, if i keep the window focussed with the mouse inside it, then it works only so far that it clicks. not at the intended spot but where the mouse is present. i.e if the said window is in focus and the mouse is inside the window, then the script clicks the mouse at that spot, not where the coordinates are.But if i minimize the window or if it is not active, then nothing happens.
So clearly , the button up and down messages are being passed but the mousemove messages are not being processed
Any suggestions on which direction i should go. Please excuse such a lengthy post.
Edit: also , ignore the PostMsg() function. It doesn't work if i use the postmessage function directly