snowreaper03 Posted August 30, 2005 Share Posted August 30, 2005 hey im trying to make something that opens a minimized window to full screen but how do u get it to pick the right minimized window? Link to comment Share on other sites More sharing options...
AutoChris Posted August 30, 2005 Share Posted August 30, 2005 hey im trying to make something that opens a minimized window to full screen but how do u get it to pick the right minimized window?<{POST_SNAPBACK}>From the Help FileWinSetState ( "title", "text", flag )Parameterstitle The title of the window to show. text The text of the window to show. flag The "show" flag of the executed program:@SW_HIDE = Hide window@SW_SHOW = Shows a previously hidden window@SW_MINIMIZE = Minimize window@SW_MAXIMIZE = Maximize window@SW_RESTORE = Undoes a window minimization or maximization@SW_DISABLE = Disables the window@SW_ENABLE = Enables the window Link to comment Share on other sites More sharing options...
Rece Posted January 15, 2006 Share Posted January 15, 2006 hey im trying to make something that opens a minimized window to full screen but how do u get it to pick the right minimized window?I'm trying the same but WinSetState() or WinActivate() doesn't work on a minimized window... I can't "open" it... Link to comment Share on other sites More sharing options...
GrungeRocker Posted January 15, 2006 Share Posted January 15, 2006 I'm trying the same but WinSetState() or WinActivate() doesn't work on a minimized window... I can't "open" it...winsetstate is working all fine on an minimized window oO [font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font] Link to comment Share on other sites More sharing options...
Rece Posted January 15, 2006 Share Posted January 15, 2006 winsetstate is working all fine on an minimized window oONot for me... I tryed these but nothing happens after minimizing all: WinMinimizeAll() Sleep(3000) WinActivate("Total Commander") WinMinimizeAll() Sleep(3000) WinSetState("Total Commander", "", @SW_RESTORE) If the Total Commander window is not minimized but is not on top then WinActivate works. But if it is minimized then not... Link to comment Share on other sites More sharing options...
rambo3889 Posted January 15, 2006 Share Posted January 15, 2006 I think this will work: Winsetstate("Total Commander","",@SW_MAXIMIZE) My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! youÂ’re the best in town Fight! Link to comment Share on other sites More sharing options...
Rece Posted January 15, 2006 Share Posted January 15, 2006 (edited) I think this will work:Winsetstate("Total Commander","",@SW_MAXIMIZE)No... ...and I don't want to maximize the window. It can be not maximized and I only want to "open" it but not change its size... Edited January 15, 2006 by Rece Link to comment Share on other sites More sharing options...
GrungeRocker Posted January 15, 2006 Share Posted January 15, 2006 well but it should work all fine oOmaybe it's a bug or you made an syn.-error or something.... [font="Verdana"]In work:[list=1][*]InstallIt[*]New version of SpaceWar[/list] [/font] Link to comment Share on other sites More sharing options...
Rece Posted January 15, 2006 Share Posted January 15, 2006 (edited) well but it should work all fine oOmaybe it's a bug or you made an syn.-error or something....I tryed it with several of the latest betas and on both Win2K and WinXP...How do you mean "syn.-error"? This 3 lines are the full code... Edited January 15, 2006 by Rece Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 15, 2006 Moderators Share Posted January 15, 2006 (edited) Sometimes theres an error in the Title (some people leave out a space or something non-trivial and spend an eternity trying to figure that out from the autoinfo tool).... Try this code exactly like this: (I am assuming that your title is correct to you)Opt('WinTitleMatchMode', 2) WinMinimizeAll() Sleep(3000) WinSetState('Total Commander', '', @SW_RESTORE)Edit:To Test this theory run this code with this window open:If you are using FireFox:WinMinimizeAll() Sleep(2000) WinSetState('etting a bot to open a minimized window? - AutoIt Forums - Mozilla Firefox', '', @SW_RESTORE) If WinActive('etting a bot to open a minimized window? - AutoIt Forums - Mozilla Firefox') Then MsgBox(0, 'Active', 'My theory sucks') Opt('WinTitleMatchMode', 2) WinMinimizeAll() Sleep(2000) WinSetState('etting a bot to open a minimized window? - AutoIt Forums - Mozilla Firefox', '', @SW_RESTORE)If you are using IE:WinMinimizeAll() Sleep(2000) WinSetState('etting a bot to open a minimized window? - AutoIt Forums - Microsoft Internet Explorer', '', @SW_RESTORE) If WinActive('etting a bot to open a minimized window? - AutoIt Forums - Mozilla Firefox') Then MsgBox(0, 'Active', 'My theory sucks') Opt('WinTitleMatchMode', 2) WinMinimizeAll() Sleep(2000) WinSetState('etting a bot to open a minimized window? - AutoIt Forums - Microsoft Internet Explorer', '', @SW_RESTORE)Notice I left off the 'g' at the beginning of the title. Edited January 15, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Rece Posted January 15, 2006 Share Posted January 15, 2006 (edited) Thanks a lot! The problem is the following: there is a visible window with title "Total Commander 6.53 - ~company name~" but there is an invisible window too with title "Total Commander"... WinMinimizeAll() Sleep(2000) WinSetState('Total Commander 6.53', '', @SW_RESTORE)^^^ This is working.Here is my script I want to use this function in. (The script watches that there is a running process of Total Commander or not and if it is running then activates its window...) I corrected it and now it's working:expandcollapse popupFunc Tiltas( $ExeUt ) If $alapb[5][1] = "0" Then $wintitle = 0 $hatar = StringInStr( $ExeUt, "\", 0, -1 ) $ExeNev = StringRight( $ExeUt, ( StringLen( $ExeUt ) - $hatar ) ) $colProcesses = $objWMIService.ExecQuery( "Select * from Win32_Process Where Name = '" & $ExeNev & "'") For $objProcess in $colProcesses If $hatar = 0 Then $objpath = $ExeUt Else $objpath = $objProcess.ExecutablePath EndIf If ( $objProcess.GetOwner(@UserName) = 0 ) And ( $objpath = $ExeUt ) Then $PID = $objProcess.ProcessID $ProcList = WinList() For $i = 1 To $ProcList[0][0] If BitAnd( WinGetState( $ProcList[$i][0] ), 2 ) And( $ProcList[$i][0] <> "" ) _ And ( StringLeft( $ProcList[$i][0], 7 ) <> "TRd ww:" ) Then If WinGetProcess( $ProcList[$i][0] ) = $PID Then Return( $ProcList[$i][0] ); return the window title EndIf EndIf Next Return Chr(149); ("") - the program is running but we can't find the window EndIf Next EndIf Return ""; the program is not running EndFunc ;... $tiltas = Tiltas( "c:\program files\totalcmd\totalcmd.exe" ) Select Case $tiltas = "" ; we do something (run the program) Case $tiltas = Chr(149) ; we do something (e.g. error message) Case Else ; we activate the window - this is interesting now WinActivate( $tiltas ) ;MsgBox(0,'debug',$tiltas) EndSelectThe solution is this line:If BitAnd( WinGetState( $ProcList[$i][0] ), 2 ) And( $ProcList[$i][0] <> "" ) And ( StringLeft( $ProcList[$i][0], 7 ) <> "TRd ww:" ) Then;...If I don't use BitAnd( WinGetState( $ProcList[$i][0] ), 2 ) then it doesn't work because the window title belongs to the invisible (hidden) window... Edit:You need this to work correctly:Opt("WinTitleMatchMode", 3); Exact match Edited January 18, 2006 by Rece 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