opey Posted March 8, 2008 Posted March 8, 2008 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
muhmuuh Posted March 8, 2008 Posted March 8, 2008 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.
martin Posted March 8, 2008 Posted March 8, 2008 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.
opey Posted March 8, 2008 Author Posted March 8, 2008 Is there a way to constantly have this stay "attached" to the main window?
muhmuuh Posted March 8, 2008 Posted March 8, 2008 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.
opey Posted March 9, 2008 Author Posted March 9, 2008 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...
muhmuuh Posted March 9, 2008 Posted March 9, 2008 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.
opey Posted March 9, 2008 Author Posted March 9, 2008 (edited) Still no luck. Which GUI should I switch it to? The main or the one I want to attach? Edited March 9, 2008 by opey
opey Posted March 9, 2008 Author Posted March 9, 2008 I've never heard of $GUI_EVENT_DROPPED... Whats it supposed to do anyway?
Mattraks Posted March 9, 2008 Posted March 9, 2008 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
opey Posted March 9, 2008 Author Posted March 9, 2008 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
opey Posted March 9, 2008 Author Posted March 9, 2008 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?
martin Posted March 9, 2008 Posted March 9, 2008 (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 March 9, 2008 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.
ByteMyCookies Posted March 9, 2008 Posted March 9, 2008 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!
Recommended Posts