gcue Posted March 2, 2009 Share Posted March 2, 2009 (edited) im trying to prevent duplicate child windows... (unfortunately they do not have unique titles) i know theres prob different ways to do this - the way i know how to would involve flags (lame i know) a better way would involve the use of if winexists,@gui_winhandle, & wingethandle but im not sure what that would look like (bc the winhandle for every child changes everytime u open the script) also, how will i get the win handle of the child before i create it? (to compare it with pre-existing ones) hope im making sense. Edited March 2, 2009 by gcue Link to comment Share on other sites More sharing options...
flyingboz Posted March 2, 2009 Share Posted March 2, 2009 hope im making sense.sadly, not. Provide a [small] code snippet demonstrating your issue. You may wish to examine your running processes w/ pslist or procexp (sysinternals utilities) -- or do you mean child windows instead of processes.... Reading the help file before you post... Not only will it make you look smarter, it will make you smarter. Link to comment Share on other sites More sharing options...
gcue Posted March 2, 2009 Author Share Posted March 2, 2009 child windows. i htink im gonna just go the route of naming every single one of them uniquely ;-) *sigh* thanks tho Link to comment Share on other sites More sharing options...
gcue Posted February 17, 2010 Author Share Posted February 17, 2010 i have a script that has several child windows.. i am trying to prevent duplicate child windows from being created.. currently this is how i am doing this: If WinExists("PC Migrator") Then MsgBox(262144, @ScriptName, "Already running PC Migrator.") Return EndIf Is there a better way to do this? i dont like this way because if there's a document that has the same heading it prevents me from running the function that opens that child window. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 17, 2010 Moderators Share Posted February 17, 2010 gcue, How do you create these child windows within your script? If it is by user interaction with a GUI, then you could disable the control that creates the child while the child is active - that would prevent duplicates. Without some code it is difficult to offer much more..... 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...
martin Posted February 17, 2010 Share Posted February 17, 2010 Or maybe, but guessing what you need, you could do something like If WinExists("SomeTitle" then WinActivate"SomeTitle") Else ;create it EndIf 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. Link to comment Share on other sites More sharing options...
gcue Posted February 17, 2010 Author Share Posted February 17, 2010 heeey martin!!! i like your idea martin but if the title matches an excel document, then that excel document gets activated... melba, the control that runs them is part of a toolbar menu.. tough to disable that no? thanks guys Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 17, 2010 Moderators Share Posted February 17, 2010 gcue,the control that runs them is part of a toolbar menu.. tough to disable that no?_GUICtrlToolbar_EnableButton - Enables or disables the specified buttonM23 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...
martin Posted February 17, 2010 Share Posted February 17, 2010 (edited) heeey martin!!! i like your idea martin but if the title matches an excel document, then that excel document gets activated... [/quote Hi gcue! Yes but maybe you could do something like this Func IsTitleFree($hParent, $st) $var = WinList($st) For $i = 1 to $var[0][0] If _WinAPI_GetParent($var[$i][1]) = $hParent "" then return False Next Return True EndFunc Edited February 17, 2010 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. 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