Jump to content
Sign in to follow this  
carlc

Minimize Window with WinSetState Problem

Recommended Posts

carlc

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?

Share this post


Link to post
Share on other sites
ByCode122

WinSetState("Adsız - Not Defteri" ,"",@SW_MINIMIZE)

Share this post


Link to post
Share on other sites
Melba23

carlc,

I doubt using WinSetState("untitled" , @SW_MINIMIZE) will "immediately minimize" Notepad as the syntax is wrong. :oops:

ByCode122 showed you the correct version of the call - you need the "text" parameter even if you only set it to a blank string (""). :bye:

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
carlc

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 by carlc

Share this post


Link to post
Share on other sites
Melba23

carlc,

Some apps do not automate easily, if at all. What is this app you are trying to minimize? :oops:

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
carlc

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.

Share this post


Link to post
Share on other sites
Melba23

carlc,

This works for me with MS Word: :oops:

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? :bye:

M23

  • Like 1

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
DelStone

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! :oops:

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×