Jump to content

PixelCoordMode


sr243
 Share

Recommended Posts

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!

Link to comment
Share on other sites

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
Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...