Sign in to follow this  
Followers 0
sr243

PixelCoordMode

4 posts in this topic

The description for this Opt is

Sets the way coords are used in the pixel functions, either absolute coords or coords relative to the window defined by hwnd (default active window):

0 = relative coords to the defined window

1 = absolute screen coordinates (default)

2 = relative coords to the client area of the defined window

But what is the difference between mode 0 and 2?

Thanks!

Share this post


Link to post
Share on other sites



Hi,

0 includes the borders and the top area with the title

2 incudes only the inner rectangle

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks Andy!

That makes sense now.

Do you happen to know whether controlgetpos is relative to the borders like mode 0 or to the inner rectangle like mode 2?

It says to the client window, so I'm assuming like mode 2, right?

Edited by sr243

Share this post


Link to post
Share on other sites

#include <GUIConstants.au3>


While 1
    For $i = 0 To 2

        Opt("GUICoordMode", $i);try the different modes 0,1,2 and look at the position of the buttons!

        GUICreate('GuiCoordMode ' & $i)
        $button0 = GUICtrlCreateButton("Button0", 5, 5, 50, 30)
        $button1 = GUICtrlCreateButton("Button1", 70, 5, 50, 30)
        $button2 = GUICtrlCreateButton("Button2", 130, 5, 50, 30)
        guictrlcreatelabel("close the window pls...",5,100,100,30)
        GUISetState()

        Sleep(1000)

        While 1
            $msg = GUIGetMsg()
            Select
                Case $msg = $GUI_EVENT_CLOSE
                    ExitLoop
            EndSelect
            $a = ControlGetPos("GuiCoordMode " & $i, "", $button0)
            ToolTip($a[0] & "  " & $a[1])
        WEnd
    Next
WEnd

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0