Jump to content

Getting a window positioin by clicking?


 Share

Recommended Posts

Could someone show me a start, i dont want you guys to tell me completely but would you give me a clue like a command or something, i know about WinGetPos, but how would i get to make that get the area and position by clicking on the window?

-----------Current Programming Language Status:Beginner: J#, Ruby Intermediate: Autoit, Java, C#, C++Advanced: Basic, Visual Basic, Fortran

Link to comment
Share on other sites

maybe

'

#include<guiconstants.au3>

$GUI = GUICreate("my gui")

$button = GUICtrlCreateButton("Get window location", 120, 150, 150, 30)

GUISetState()


While 1
    
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit
    if $msg = $button Then
        $array = WinGetPos($GUI)
        MsgBox(0,"win position", $array[0] & "= X position" & $array[1] & "= Y position" & @CRLF & _
        $array[2] & "= Width" & $array[3] & "= Height") 
    EndIf
WEnd

8)

NEWHeader1.png

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...