benzrf Posted July 14, 2011 Share Posted July 14, 2011 Is there a way to move a GUI you created without using WinMove? It seems to me that WinMove is a bit sloppy (could register something else or glitch if you have two instances open?). I can find numerous ways to move controls around in a GUI, but I can't figure out any way to move the GUI itself! Link to comment Share on other sites More sharing options...
JohnOne Posted July 14, 2011 Share Posted July 14, 2011 It seems to me that WinMove is a bit sloppy (could register something else or glitch if you have two instances open?).When you have a handle to your GUI I doubt it will "glitch" as windows cannot share the same handle. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
sleepydvdr Posted July 14, 2011 Share Posted July 14, 2011 Is there a way to move a GUI you created without using WinMove? It seems to me that WinMove is a bit sloppy (could register something else or glitch if you have two instances open?). I can find numerous ways to move controls around in a GUI, but I can't figure out any way to move the GUI itself! What's sloppy about it? It is very precise. You can use WinGetPos to find it's current position and move it to a precise number of pixels in x and y coordinates. Example: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("My Window", 280, 180, -1, -1) $Button1 = GUICtrlCreateButton("Move", 88, 64, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $currentPosition = WinGetPos("My Window") WinMove("My Window", "", $currentPosition[0] + 50, $currentPosition[1] - 50) EndSwitch WEnd #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
JohnOne Posted July 14, 2011 Share Posted July 14, 2011 Indeed. Or WinMove($Form1, "", $currentPosition[0] + 50, $currentPosition[1] - 50); theres no getting crossed wires there. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
benzrf Posted July 15, 2011 Author Share Posted July 15, 2011 Ohhhhhh... I didn't realize you could use a handle in WinMove. Thanks! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 15, 2011 Moderators Share Posted July 15, 2011 benzrf,You can always use the handle in place of "title" in any native AutoIt function - but do not forget to set the "text" parameter to "" if you do. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now