Jump to content

Recommended Posts

Posted

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

Posted

Check WinGetPos()

$size=WinGetPos("")

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

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

Posted

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

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.

Posted

I did like this:

Case $msg = $GUI_EVENT_DROPPED
            $nPos = WinGetPos($XSkinGui, "")
            $nPos1 = $nPos[0]
            $nPos2 = $nPos[1] + $nPos[3]
            WinMove($hudGUI, "", $npos1, $npos2)

and its not working...

Posted

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.

Posted (edited)

Still no luck. Which GUI should I switch it to? The main or the one I want to attach?

Edited by opey
Posted

I've never heard of $GUI_EVENT_DROPPED...

Whats it supposed to do anyway?

It means that when you let go of the gui. As in, you were dragging it and the let go of it. Thats what the event of $GUI_EVENT_DROPPED

Posted

Well I've been dropping the window for the past 20 minutes and even put a simple msgbox to see if it was going to that case and its not. The msgbox is not appearing

Posted

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?

Posted (edited)

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

Or you can use,

AdlibEnable ( "_ResetWin", 10)
Func _ResetWin()
$size=WinGetPos("")
$BlCoord = $size[0], $size[1]+$size[3]
$BrCoord = $size[0]+$size[2], $size[1]+$size[3]
WinMove($Gui, "", $BlCoord, $BrCoord)
Endfunc

(Untested, but should work)

My Scripts,[topic="65986"]AI Example[/topic] ,Capable of Emotion!

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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