Hypertrophy Posted August 16, 2009 Share Posted August 16, 2009 (edited) Credits and thanks to Melba for creating this code. expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Run("Notepad") WinWaitActive("Untitled - Notepad") ; Create My_GUI and use TOPMOST Global $hMy_GUI = GUICreate("My GUI", 300, 300, 20, 20, -1, $WS_EX_TOPMOST) GUISetState(@SW_HIDE) ; Set visible flag (assuming it is visible to begin with!) Global $fMy_GUI_Vis = False ; Declare last position variables Global $iLast_X = 0 Global $iLast_Y = 0 While 1 ; Other loop code If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit ; Correct position of My_GUI if required If WinActive("Untitled - Notepad") Or WinActive($hMy_GUI) Then $aExternal_Pos = WinGetPos("Untitled - Notepad") If IsArray($aExternal_Pos) Then If $aExternal_Pos[0] <> $iLast_X Or $aExternal_Pos[1] <> $iLast_Y Then $iLast_X = $aExternal_Pos[0] $iLast_Y = $aExternal_Pos[1] WinMove($hMy_GUI, "", $aExternal_Pos[0] + 40, $aExternal_Pos[1] + 60) EndIf EndIf EndIf ; Hide My_GUI when External not active If BitAND(WinGetState("Untitled - Notepad"), 8) <> 8 And $fMy_GUI_Vis = True Then GUISetState(@SW_HIDE, $hMy_GUI) $fMy_GUI_Vis = False ElseIf BitAND(WinGetState("Untitled - Notepad"), 8) = 8 And $fMy_GUI_Vis = False Then GUISetState(@SW_SHOW, $hMy_GUI) $fMy_GUI_Vis = True EndIf ; Reactivate External when My_GUI is activated If WinActive($hMy_GUI) Then WinActivate("Untitled - Notepad") EndIf WEnd how can i change it so this method of hiding and showing your GUI will work with multiple GUI's? Edit: Oops, forgot to post code >_< Edited August 16, 2009 by Hypertrophy Link to comment Share on other sites More sharing options...
Yashied Posted August 16, 2009 Share Posted August 16, 2009 Credits and thanks to Melba for creating this code.how can i change it so this method of hiding and showing your GUI will work with multiple GUI's?Where is this code? 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...
Moderators Melba23 Posted August 16, 2009 Moderators Share Posted August 16, 2009 Hypertrophy,It is not difficult - you just have to replicate all the code for each additional GUI. And I am not doing it for you. >_< But the whole script slows down as you each additional GUI, so you might find the result less than satisfactory if yo add too many.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...
Hypertrophy Posted August 16, 2009 Author Share Posted August 16, 2009 Well that sucks >_< I guess I'm back at square one then. What I'm trying to understand is how to make windows in autoit that can follow around and "copy" the window I tell it to. Making it a child is not enough I suppose. I want the window I make to minimize with an external window, to follow it around, and to hide when the external window is out of focus? Is this possible? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 16, 2009 Moderators Share Posted August 16, 2009 Hypertrophy, What do you mean by "copy"? 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...
Hypertrophy Posted August 16, 2009 Author Share Posted August 16, 2009 What I mean is when the "parent" window minimizes, so does all the of the little windows I created on it. When the "parent" window moves, the little windows i created on it move with it. When the "parent" window goes behind another window, so does the little windows I assigned to it. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 16, 2009 Moderators Share Posted August 16, 2009 Hypertrophy, I am afraid that is way beyond my hobbyist coding ability. The code you have is as far as I have ever gone. Good luck! 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...
Hypertrophy Posted August 16, 2009 Author Share Posted August 16, 2009 I'll need it. 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