carlc Posted March 10, 2012 Share Posted March 10, 2012 Strange problem, if I open a program with say Run("c:\dir1\dir2\program.exe"), and then use WinSetState("WindowTitle" , @SW_MINIMIZE), the window will not minimize. But, if I open notepad with Run("notepad.exe"), and then use WinSetState("untitled" , @SW_MINIMIZE), Notepad will immediately minimize. ??? I'm using 32-bit Windows 7. Any ideas? Link to comment Share on other sites More sharing options...
ByCode122 Posted March 10, 2012 Share Posted March 10, 2012 WinSetState("Adsız - Not Defteri" ,"",@SW_MINIMIZE) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 10, 2012 Moderators Share Posted March 10, 2012 carlc,I doubt using WinSetState("untitled" , @SW_MINIMIZE) will "immediately minimize" Notepad as the syntax is wrong. ByCode122 showed you the correct version of the call - you need the "text" parameter even if you only set it to a blank string (""). 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...
carlc Posted March 10, 2012 Author Share Posted March 10, 2012 (edited) Sorry, typo on my part. I didn't have my code to look at when I posted (and I just started using AutoIT). I did have the syntax correct in my script, and as I said, notepad would minimize for me using the code, but if I called a program by having to put in the path, it won't minimize. ??? Edited March 10, 2012 by carlc Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 10, 2012 Moderators Share Posted March 10, 2012 carlc, Some apps do not automate easily, if at all. What is this app you are trying to minimize? 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...
carlc Posted March 10, 2012 Author Share Posted March 10, 2012 The program that I am trying to minimize is OpenOffice Impress. I've also tried minimizing MS Word, MS PowerPoint, and MS Excel, none of which will minimize for me. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 10, 2012 Moderators Share Posted March 10, 2012 carlc,This works for me with MS Word: Run("C:Program FilesMicrosoft OfficeOfficeWINWORD.EXE") WinWaitActive("Document1 - Microsoft Word") WinSetState("Document1 - Microsoft Word", "", @SW_MINIMIZE)Did you use the WinWaitActive line to give the window a chance to open first? M23 DelStone 1 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...
DelStone Posted March 10, 2012 Share Posted March 10, 2012 I often make the same mistake Melba - should really have a check to ensure the window exists the set state function - a subtle prob for noobies that gets them pulling their hair out! 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