Encryption Posted February 18, 2005 Posted February 18, 2005 Mkay first I will start off with the code I am doing for a friend. ;Mason's Improved Internet Explorer Hide HotKeySet("{PGUP}", "Restore") HotKeySet("{PGDN}", "Hide") HotKeySet("{ESC}", "Terminate") Opt("WinTitleMatchMode", 2) ToolTip("Explorer Hide V2.0 Is Active", 0, 0) While 1 WEnd Func Restore() ToolTip("Explorer Hide V2.0 Is Active", 0, 0) WinSetState("Microsoft Internet Explorer", "", @SW_SHOW) EndFunc Func Hide() ToolTip("", 3000, 3000) WinSetState("Microsoft Internet Explorer", "", @SW_HIDE) EndFunc Func Terminate() Exit 0 EndFunc Now, this does everything needed, but I want it to Hide Multiple IE's(all that are minimized and active) and then Restore all the ones that i just hid. Possible?
CyberSlug Posted February 19, 2005 Posted February 19, 2005 You should enumerate all windows that match the title, grab their window handles to tell them apart, and call WinSetState on each handle:REPLACE WinSetState("Microsoft Internet Explorer", "", @SW_HIDE)with the following:Local $windows = WinList("Microsoft Internet Explorer") For $i = 1 to $windows[0][0] WinSetState($windows[$i][1], "", @SW_HIDE) NextLikewise with @SW_SHOW Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Encryption Posted February 19, 2005 Author Posted February 19, 2005 (edited) You should enumerate all windows that match the title, grab their window handles to tell them apart, and call WinSetState on each handle:REPLACE WinSetState("Microsoft Internet Explorer", "", @SW_HIDE)with the following:Local $windows = WinList("Microsoft Internet Explorer") For $i = 1 to $windows[0][0] WinSetState($windows[$i][1], "", @SW_HIDE) NextLikewise with @SW_SHOW<{POST_SNAPBACK}>Thank you very much, helped a lotEDIT:There is an error where the array is declared. I am not a big fan of arrays in AutoIt, nor do I know them well. Do you see any errors?EDIT: I fixed it, just declared a new array for the other For statement, sorry, my error. Edited February 19, 2005 by Encryption
CyberSlug Posted February 19, 2005 Posted February 19, 2005 (edited) There is an error where the array is declared. I am not a big fan of arrays in AutoIt, nor do I know them well. Do you see any errors?<{POST_SNAPBACK}>Works okay for me with zero, one, or many windows: HotKeySet("{PGUP}", "Restore") HotKeySet("{PGDN}", "Hide") HotKeySet("{ESC}", "Terminate") Opt("WinTitleMatchMode", 2) ToolTip("Explorer Hide V2.0 Is Active", 0, 0) While 1 sleep(100);prevent maxing out the CPU WEnd Func Restore() ToolTip("Explorer Hide V2.0 Is Active", 0, 0) _SetIEState(@SW_SHOW) EndFunc Func Hide() ToolTip('') _SetIEState(@SW_HIDE) EndFunc Func _SetIEState($state) Local $i, $windows = WinList("Microsoft Internet Explorer") For $i = 1 to $windows[0][0] WinSetState($windows[$i][1], "", $state) Next EndFunc Func Terminate() Exit 0 EndFuncEDIT: Re-wrote code a little bit. Edited February 19, 2005 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Encryption Posted February 19, 2005 Author Posted February 19, 2005 Thanks again, my friend will be very happy. I think he is going to sign up in a bit and thank you, he is an AutoIt newbie(yes, more than me) so he will be asking for help quite often.
Lakai[NL] Posted February 19, 2005 Posted February 19, 2005 Yes, thanks alot for the help cyber, that was the last piece of the script that we needed help on
therks Posted February 20, 2005 Posted February 20, 2005 Invasion of the newbs! My AutoIt Stuff | My Github
Blue_Drache Posted February 20, 2005 Posted February 20, 2005 Invasion of the newbs! <{POST_SNAPBACK}>*runs around screaming "OMG WE'RE ALL GOING TO DIE!!!"* Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache
Insolence Posted February 20, 2005 Posted February 20, 2005 Calmly stands ground with AutoIT Help File* "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
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