RedneckTech Posted October 5, 2011 Posted October 5, 2011 trying to activate a window. currently WinActivate is not working for me. WinActivate("title") WinWaitActive("Title") If Winactive = 0 Then _errortag("title") Exit EndIf ive put message boxes all through there, the program hits that loop, but never activates the window. ive tried getting it to run multiple ways. the window is open and already minimized to the taskbar. if there is a way to maximize and activate a window it would be much appreciated. even went so far as to start trying _WinAPI functions to no avail. unless you know how to send keystrokes/commands to a minimized window without activating it, this is a major cramp in the programming process
Moderators Melba23 Posted October 5, 2011 Moderators Posted October 5, 2011 RedneckTech, Perhaps this will explain how to activate a minimized GUI: #include <GUIConstantsEx.au3> ; Create our GUI $hGUI = GUICreate("Test", 500, 500) GUISetState() ; Minimize SciTE GUI $sTitle = WinGetTitle("[CLASS:SciTEWindow]") WinSetState($sTitle, "", @SW_MINIMIZE) Sleep(2000) ; And now wake it again WinSetState($sTitle, "", @SW_RESTORE) WinActivate($sTitle) WinWaitActive($sTitle) If Winactive($sTitle) = 0 Then ConsoleWrite("Error" & @CRLF) Exit EndIf ; And wait here While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd 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
RedneckTech Posted October 5, 2011 Author Posted October 5, 2011 thank you sooooooo much. if theres one thing i hate more than programming its editing someone elses work. combine those 2 and ive been tearing my hair out all day trying to figure this out lol mainly just been afraid of getting into the GUI stuff as im still pretty nooby at this
Moderators Melba23 Posted October 5, 2011 Moderators Posted October 5, 2011 RedneckTech, My pleasure. Do not be afraid of asking even simple questions like that - some of us need all the hair we have left and if we can save any......! 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
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