Sorry for mistake report.

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
peter723pan
Posts: 15
Joined: 01 Sep 2014, 15:21

Sorry for mistake report.

24 Feb 2017, 09:51

If [ MouseGetPos, xpos, ypos ] before [ DllCall("SelectObject", "uint", hdc, "uint", obm) ] every thing works fine. Gets x,y of screen position.

Code: Select all

                CoordMode, Mouse, Screen
                MouseGetPos, xpos, ypos
                WinGetPos, X, Y, , , %myTitle%
                DllCall("SelectObject", "uint", hdc, "uint", obm)

but if [ DllCall("SelectObject", "uint", hdc, "uint", obm) ] before [ MouseGetPos, xpos, ypos ] , [ CoordMode, Mouse, Screen] will not work , gets x,y of active window relative position.

Code: Select all

                DllCall("SelectObject", "uint", hdc, "uint", obm)               
                CoordMode, Mouse, Screen
                MouseGetPos, xpos, ypos
                WinGetPos, X, Y, , , %myTitle%               
              
It seems like
DllCall("SelectObject", "uint", hdc, "uint", obm)
makes lock in
CoordMode, Mouse, Relative
CoordMode, Mouse, Window


The Version is 1.1.24.05
Last edited by peter723pan on 24 Feb 2017, 13:15, edited 2 times in total.
just me
Posts: 9442
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: After [DllCall "SelectObject"] , [CoordMode, Mouse, Screen] doesn't work.

24 Feb 2017, 10:01

Would you please provide a working example?
peter723pan
Posts: 15
Joined: 01 Sep 2014, 15:21

Re: After [DllCall "SelectObject"] , [CoordMode, Mouse, Screen] doesn't work.

24 Feb 2017, 12:22

Hours ago , add codes for my slideshow script suit for multi-monitors .

If middle click in the second monitor , it fullscreen in the second monitor.
But it fail , I checked it , MouseGetPos returned relative position.

CoordMode, Mouse, Screen < Not worked , after I changed it to before DllCall it worked.

BUT NOW, I ctrl+z undo changes in EmEditor (editor I wrote script in) , compile to exe and run the script which last time failed to get screen position , it works now.

I don't know WTF, maybe it was the dynamic compile didn't completely recompiled when last time I check it , so the change in code didn't make effect.


Is it any way to force AHK to clear dynamic compile cache?
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Sorry for mistake report.

24 Feb 2017, 19:17

There is no such thing.

Just remember to save the file before you compile, and reload the script after.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada, mmflume, scriptor2016, ShatterCoder and 156 guests