Justforfun Posted July 14, 2010 Share Posted July 14, 2010 (edited) OK I have looked threw the Help File not finding anything. When I run my script my main GUI opens I have a button when pushed runs another script and my second GUI opens is there away to make this GUI window automatically snap to the bottom of the main GUI window. So it looks like this. Edited July 14, 2010 by Justforfun Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 14, 2010 Share Posted July 14, 2010 1. WinGetHandle() to ID the first window. 2. WinGetPos() to get position and size of first window. 3. WinMove() to move second window to the correct position. 4. Use a loop or an AdLibRegister() function to repeat the process, if required. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Yashied Posted July 14, 2010 Share Posted July 14, 2010 (edited) Something like this. expandcollapse popup#Include <GUIConstantsEx.au3> #Include <WindowsConstants.au3> $hOpt = 0 $hForm = GUICreate('MyGUI', 400, 400, 600, 100, BitOR($WS_CAPTION, $WS_POPUP, $WS_SYSMENU)) $Button = GUICtrlCreateButton('Options', 165, 366, 70, 23) GUIRegisterMsg($WM_ACTIVATE, 'WM_ACTIVATE') GUIRegisterMsg($WM_MOVE, 'WM_MOVE') GUISetState() While 1 $Msg = GUIGetMsg(1) Switch $Msg[0] Case -3 Switch $Msg[1] Case $hForm Exit Case $hOpt GUICtrlSetState($Button, $GUI_ENABLE) GUIDelete($hOpt) $hOpt = 0 EndSwitch Case $Button If Not $hOpt Then $Pos = WinGetPos($hForm) $hOpt = GUICreate('Options', 400, 100, $Pos[0], $Pos[1] + 436, BitOR($WS_CAPTION, $WS_POPUP, $WS_SYSMENU)) GUISetState(@SW_SHOWNOACTIVATE, $hOpt) GUICtrlSetState($Button, $GUI_DISABLE) EndIf EndSwitch WEnd Func WM_ACTIVATE($hWnd, $iMsg, $wParam, $lParam) Switch BitAND($wParam, 0xFFFF) Case 1, 2 Switch $hWnd Case 0 Case $hForm If $hOpt Then WinSetOnTop($hOpt, '', 1) WinSetOnTop($hOpt, '', 0) EndIf Case $hOpt WinSetOnTop($hForm, '', 1) WinSetOnTop($hForm, '', 0) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_ACTIVATE Func WM_MOVE($hWnd, $iMsg, $wParam, $lParam) $X = BitAND($lParam, 0xFFFF) If $X > 0x7FFF Then $X -= 0x10000 EndIf $Y = BitShift($lParam, 16) If $Y > 0x7FFF Then $Y -= 0x10000 EndIf Switch $hWnd Case 0 Case $hForm If $hOpt Then WinMove($hOpt, '', $X - 3, $Y + 407) EndIf Case $hOpt WinMove($hForm, '', $X - 3, $Y - 465) EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_MOVE EDIT: Code Edited July 14, 2010 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 14, 2010 Share Posted July 14, 2010 Teach to fish... give a fish... etc. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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