slightly_abnormal Posted March 2, 2006 Share Posted March 2, 2006 I have multiple windows of opera, I have made a program that should hide opera, but it will hide only the active window, how do i hide/show/minimize all instances of the program? if ProcessExists("opera.exe) Then opt ("WinTitleMatchMode", 2) WinSetState ("opera", "", @SW_HIDE) Endif if ProcessExists("opera.exe") Then opt ("WinTitleMatchMode", 2) WinSetState ("opera", "", @SW_SHOW) Endif if ProcessExists("opera.exe) Then opt ("WinTitleMatchMode", 2) WinSetState ("opera", "", @SW_MINIMIZE) Endif Link to comment Share on other sites More sharing options...
GaryFrost Posted March 2, 2006 Share Posted March 2, 2006 (edited) I don't have Opera, but if i have a partial of the title wrong then just change that Here's an Example of the Hide/Show opt ("WinTitleMatchMode", 2) $win_title = "Opera" ; hide the windows $wlist = WinList($win_title) For $x = 1 To $wlist[0][0] WinSetState($wlist[$x][0],'',@SW_HIDE) Next ; show the windows $wlist = WinList($win_title) For $x = 1 To $wlist[0][0] WinSetState($wlist[$x][0],'',@SW_SHOW) Next Edited March 2, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
slightly_abnormal Posted March 3, 2006 Author Share Posted March 3, 2006 Hey, thanks again Link to comment Share on other sites More sharing options...
slightly_abnormal Posted March 3, 2006 Author Share Posted March 3, 2006 (edited) Hey, thanks again for future references.. here's a working script as an example.. expandcollapse popup#include <GUIConstants.au3> #NoTrayIcon Opt ("RunErrorsFatal", 0 ) Global $Paused HotKeySet("{ESC}", "Terminate") Func Terminate() Exit 0 EndFunc GuiCreate("Hide/Show 0pera", 280, 80,-1, -1, -1, $WS_EX_TOPMOST) ;== Small label ==; $Group_1 = GuiCtrlCreateGroup("Hide/Show Opera", 10, 10, 260, 60) GUICtrlSetFont(-1, 9, 400, 0, "georgia") ;Hide Opera $Button1 = GuiCtrlCreateButton("Hide Opera", 30, 30, 110, 30) GUICtrlSetFont(-1, 9, 400, 0, "georgia") ;Show Opera $Button2 = GuiCtrlCreateButton("Show Opera", 140, 30, 110, 30) GUICtrlSetFont(-1, 9, 400, 0, "georgia") ;Hide window opt ("WinTitleMatchMode", 2) $win_title = "Opera" GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE exitloop ;Hide ;==========================> Case $msg = $button1 ; hide the windows $wlist = WinList($win_title) For $x = 1 To $wlist[0][0] WinSetState($wlist[$x][0],'',@SW_HIDE) Next ;Show ;==========================> Case $msg = $button2 ; show the windows $wlist = WinList($win_title) For $x = 1 To $wlist[0][0] WinSetState($wlist[$x][0],'',@SW_SHOW) next #cs =comment ;Minimize (disabled) ;==========================> Case $msg = $button2 ; show the windows $wlist = WinList($win_title) For $x = 1 To $wlist[0][0] WinSetState($wlist[$x][0],'',@SW_MINIMIZE) next #ce endselect Wend Edited March 3, 2006 by slightly_abnormal Link to comment Share on other sites More sharing options...
slightly_abnormal Posted March 4, 2006 Author Share Posted March 4, 2006 hey, do you know how i can get this to use one button two functions? expandcollapse popup#include <GUIConstants.au3> #NoTrayIcon Opt ("RunErrorsFatal", 0 ) Global $Paused HotKeySet("{ESC}", "Terminate") Func Terminate() Exit 0 EndFunc GuiCreate("Control 0pera", 280, 80,-1, -1, -1, $WS_EX_TOPMOST) ;== Small label ==; $Group_1 = GuiCtrlCreateGroup("Control Opera", 10, 10, 260, 60) GUICtrlSetFont(-1, 9, 400, 0, "georgia") ;Hide Opera $Button1 = GuiCtrlCreateButton("Hide/Show Opera", 30, 30, 110, 30) GUICtrlSetFont(-1, 9, 400, 0, "georgia") ;Show Opera $Button2 = GuiCtrlCreateButton("Min/Res Opera", 140, 30, 110, 30) GUICtrlSetFont(-1, 9, 400, 0, "georgia") ;Hide window opt ("WinTitleMatchMode", 2) $win_title = "Opera" GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE exitloop ;Hide/Show ;==========================> Case $msg = $button1 ; hide the windows $wlist = WinList($win_title) For $x = 1 To $wlist[0][0] WinSetState($wlist[$x][0],'',@SW_HIDE) Next $wlist = WinList($win_title) For $x = 1 To $wlist[0][0] WinSetState($wlist[$x][0],'',@SW_SHOW) Next ;Minimize/Restore ;==========================> Case $msg = $button2 ; show the windows $wlist = WinList($win_title) For $x = 1 To $wlist[0][0] WinSetState($wlist[$x][0],'',@SW_MINIMIZE) next $wlist = WinList($win_title) For $x = 1 To $wlist[0][0] WinSetState($wlist[$x][0],'',@SW_RESTORE) Next endselect Wend Link to comment Share on other sites More sharing options...
GaryFrost Posted March 4, 2006 Share Posted March 4, 2006 (edited) not tested: expandcollapse popup#include <GUIConstants.au3> #NoTrayIcon Opt("RunErrorsFatal", 0) Global $Paused, $toggle_hide = 1, $toggle_min = 1, $hide_flag = @SW_HIDE, $min_flag = @SW_MINIMIZE HotKeySet("{ESC}", "Terminate") GUICreate("Control 0pera", 280, 80, -1, -1, -1, $WS_EX_TOPMOST) ;== Small label ==; $Group_1 = GUICtrlCreateGroup("Control Opera", 10, 10, 260, 60) GUICtrlSetFont(-1, 9, 400, 0, "georgia") ;Hide Opera $Button1 = GUICtrlCreateButton("Hide/Show Opera", 30, 30, 110, 30) GUICtrlSetFont(-1, 9, 400, 0, "georgia") ;Show Opera $Button2 = GUICtrlCreateButton("Min/Res Opera", 140, 30, 110, 30) GUICtrlSetFont(-1, 9, 400, 0, "georgia") ;Hide window Opt("WinTitleMatchMode", 2) $win_title = "Opera" GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop ;Hide/Show ;==========================> Case $msg = $Button1 ; hide the windows $wlist = WinList($win_title) If $toggle_hide Then $hide_flag = @SW_HIDE Else $hide_flag = @SW_SHOW EndIf For $x = 1 To $wlist[0][0] WinSetState($wlist[$x][0], '', $hide_flag) Next $toggle_hide = Not $toggle_hide ;Minimize/Restore ;==========================> Case $msg = $Button2 ; show the windows $wlist = WinList($win_title) If $toggle_min Then $min_flag = @SW_MINIMIZE Else $min_flag = @SW_RESTORE EndIf For $x = 1 To $wlist[0][0] WinSetState($wlist[$x][0], '', $min_flag) Next $toggle_min = Not $toggle_min EndSelect WEnd Func Terminate() Exit 0 EndFunc ;==>Terminate Edited March 4, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
slightly_abnormal Posted March 4, 2006 Author Share Posted March 4, 2006 wow.. you really know your stuff.. thanks, 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