TonyHex Posted May 1, 2013 Share Posted May 1, 2013 (edited) Hi folks I trying to find solution how to Restore or Maximize my minimized Chrome explorer So far this doesn't work 4 me: WinSetState("[CLASS:Chrome_WidgetWin_1]", "",@SW_RESTORE ) or this one : WinSetState("[CLASS:Chrome_WidgetWin_1]", "",@SW_MAXIMIZE) I have win8 so I thought that is why it doesn't work but when I check it on xp it not works as well.. What I am doing wrong? somehow this one works but I will not have google page all the timeWinSetState("Google - Google Chrome", "",@SW_RESTORE ) Edited May 1, 2013 by TonyHex Link to comment Share on other sites More sharing options...
TonyHex Posted May 1, 2013 Author Share Posted May 1, 2013 Edit:It is bug IMO all others CLASSes[CLASS:MozillaWindowClass][CLASS:HH Parent][CLASS:CalcFrame][CLASS:Notepad]etc....works fine so its only chrome what doesn't work Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 1, 2013 Moderators Share Posted May 1, 2013 TonyHex,Are you sure that the CLASS you are using refers to the main Chrome GUI and not something smaller within it? Chrome_WidgetWin_1 does not sound a likely CLASS for the main GUI to me. 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...
mikell Posted May 1, 2013 Share Posted May 1, 2013 (edited) Maybe WinGetHandle() can do the work The help file says "Once you have obtained the handle you can access the required window even if its title changes." An other way can be Opt("WinTitleMatchMode", -2) WinSetState("chrome", "", @SW_RESTORE) or a clever mix of both Edited May 1, 2013 by mikell Link to comment Share on other sites More sharing options...
TonyHex Posted May 1, 2013 Author Share Posted May 1, 2013 I am quite sure I using correct class. Link to comment Share on other sites More sharing options...
TonyHex Posted May 1, 2013 Author Share Posted May 1, 2013 Maybe WinGetHandle() can do the work An other way can be Opt("WinTitleMatchMode", -2) WinSetState("chrome", "", @SW_RESTORE) or a clever mix of both Thanks folks for suggestion but none of them works Link to comment Share on other sites More sharing options...
BrewManNH Posted May 1, 2013 Share Posted May 1, 2013 (edited) On windows 7 x64 this works. WinSetState("[CLASS:Chrome_WidgetWin_1]", "",@SW_RESTORE ) And this also works for me. WinSetState("[CLASS:Chrome_WidgetWin_1]", "",@SW_MINIMIZE ) Perhaps you need to use #RequireAdmin, although I'm not sure why you would, but with Win8, I have no experience in using it. edit: miscopied the second script line, should have been using @SW_MINIMIZE instead of use _RESTORE twice, I have corrected it above. Edited May 1, 2013 by BrewManNH If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
TonyHex Posted May 1, 2013 Author Share Posted May 1, 2013 On windows 7 x64 this works. WinSetState("[CLASS:Chrome_WidgetWin_1]", "",@SW_RESTORE ) And this also works for me. WinSetState("[CLASS:Chrome_WidgetWin_1]", "",@SW_RESTORE )Thanks 4 info BrewManNH Both looks same to me I already tried them nothing happen . I give it one more try just in case I miss something or typed it wrong at this one pop up at me: I guess there is something wrong with chrome I have to specify more what I want restore. Cuz I have multiple chrome running in same time and there is multiple chrome runnig at background : Link to comment Share on other sites More sharing options...
BrewManNH Posted May 1, 2013 Share Posted May 1, 2013 Everytime you open a new tab or a new window for Chrome it creates a new program instance, sometimes several. I have several running right now on my system and that scriptlet would minimize the main window of Chrome for me. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
TonyHex Posted May 1, 2013 Author Share Posted May 1, 2013 Yes minimize works fine but not other way. Link to comment Share on other sites More sharing options...
BrewManNH Posted May 1, 2013 Share Posted May 1, 2013 Restore worked for me on when I tested it. When you use @SW_RESTORE, what state is the Chrome window in prior to using it, and what happens after you try it with that option? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
TonyHex Posted May 1, 2013 Author Share Posted May 1, 2013 I staring to be confuse nowI have chrome minimized and I want it to @restore or @maximize or some other way show in desktop.So after I run this codeWinSetState("[CLASS:Chrome_WidgetWin_1]", "",@SW_RESTORE )1. when chrome is minimized and has no any page open yetthis will pop up2. After load some page (google.com) and minimize chrome by hand and run code again this will pop up3.if I have chrome on screen and run code nothing happen Link to comment Share on other sites More sharing options...
BrewManNH Posted May 1, 2013 Share Posted May 1, 2013 Well, I don't have Windows 8 available to test it on, so I can only tell you that it's working with Windows 7, it might very well have to do with something in Win8 or the version of Chrome that you're running. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
MouseSpotter Posted May 1, 2013 Share Posted May 1, 2013 I get the same as TonyHex on WinXP SP3 .... the maximize does nothing (the window state is changed ... when I click the taskbar icon to restore the window it shows maximized)... however there is a transparent frame shown on the desktop, Link to comment Share on other sites More sharing options...
MouseSpotter Posted May 1, 2013 Share Posted May 1, 2013 (edited) Ah-ha! Think I have found it ,,, there are more than one window with "[CLASS:Chrome_WidgetWin_1]" when chrome is minimized. $var = WinList() For $i = 1 to $var[0][0] ; Only display visble windows that have a title If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then WinSetState($var[$i][0],"", @SW_MAXIMIZE) EndIf Next Func IsVisible($handle) If BitAnd( WinGetState($handle), 2 ) Then Return 1 Else Return 0 EndIf EndFunc maximizes Chrome (and all other windows). Edited May 1, 2013 by MouseSpotter Link to comment Share on other sites More sharing options...
BrewManNH Posted May 1, 2013 Share Posted May 1, 2013 Which is another reason to add to the many already as to why I didn't update to Win8 and only use XP on the computers at work. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
TonyHex Posted May 1, 2013 Author Share Posted May 1, 2013 Ah-ha! Think I have found it ,,, there are more than one window with "[CLASS:Chrome_WidgetWin_1]" when chrome is minimized. $var = WinList() For $i = 1 to $var[0][0] ; Only display visble windows that have a title If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then WinSetState($var[$i][0],"", @SW_MAXIMIZE) EndIf Next Func IsVisible($handle) If BitAnd( WinGetState($handle), 2 ) Then Return 1 Else Return 0 EndIf EndFunc maximizes Chrome (and all other windows). yes this one work thanks MouseSpotter Is there any way how to extract chrome only? I mean how to make it work at chrome only and not all windows? Link to comment Share on other sites More sharing options...
TonyHex Posted May 1, 2013 Author Share Posted May 1, 2013 Oala......this is realy Lame but it does a job Local $var = WinList() For $i = 1 To $var[0][0] ; Only display visble windows that have a title If $var[$i][0] <> "" And IsVisible($var[$i][1]) Then Local $result = StringInStr($var[$i][0], "Chrome") if $result > 0 Then WinSetState($var[$i][0],"", @SW_RESTORE) EndIf EndIf Next Func IsVisible($handle) If BitAND(WinGetState($handle), 2) Then Return 1 Else Return 0 EndIf EndFunc ;==>IsVisible Link to comment Share on other sites More sharing options...
jdelaney Posted May 1, 2013 Share Posted May 1, 2013 (edited) You can even do this: Func IsVisible($handle) Return BitAND(WinGetState($handle), 2) EndIf since if statements only care if 0, or not 0 (true) also, you can use the window handle in: _WinAPI_GetClassName($hwnd) to verify the window class, rather than the title...but up to you edit: small change with no real benefit Edited May 1, 2013 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
MouseSpotter Posted May 1, 2013 Share Posted May 1, 2013 Which is another reason to add to the many already as to why I didn't update to Win8 and only use XP on the computers at work.*cough* I reproduced the issue on a Win XP SP3 machine. 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