Jump to content

Finding position of my window


Recommended Posts

I need someway to find the coordinates of the bottom left and right of my window. Because I want to open up a new gui with a click of a button and it will attach itself to the bottom of my window.

Please help.

Thanks

Link to comment
Share on other sites

Check WinGetPos()

$size=WinGetPos("")

The bottom left coordinates should be $size[0]+$size[2], $size[1]+$size[3]

Only in a mirror. :)

Without the mirror

Bottom left = $size[0], $size[1]+$size[3]

Bottom Right = $size[0]+$size[2], $size[1]+$size[3]

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

in the loop where you do $msg=GuiGetMsg() you can add case

$msg==$GUI_EVENT_DROPPED and then get the new coordinates and move the new window

I ran. I ran until my muscles burned and my veins pumped battery acid. Then I ran some more.

Link to comment
Share on other sites

Two things

When you have 2 or more guis GuiGetMsg gets the msg of the current gui (int your case would be the second gui as it is created later). I think you should use GUISwitch(). Also WinGetPos() and WinMove use title as argument and you put handle. You should put title there.

I'm noob and it is possible that I'm writing trash and if so please someone correct me.

I ran. I ran until my muscles burned and my veins pumped battery acid. Then I ran some more.

Link to comment
Share on other sites

Is there something else I can use besides $GUI_EVENT_DROPPED? Like maybe a case $msg that will detect whenever the main window is moved?

all you need is

Global Const $WM_ENTERSIZEMOVE = 0x231,$WM_EXITSIZEMOVE = 0x232
GUIRegisterMsg($WM_EXITSIZEMOVE,'My_Exit_SIZEMOVE')

..

Func My_Exit_SIZEMOVE()

;code to move your other window here
endfunc
Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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