Jump to content

Recommended Posts

Posted

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?

Posted

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)       
Next

Likewise 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!
Posted (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)       
Next

Likewise with @SW_SHOW

<{POST_SNAPBACK}>

Thank you very much, helped a lot

EDIT:

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 by Encryption
Posted (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: :lmao:
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
EndFunc

EDIT: Re-wrote code a little bit.

Edited 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!
Posted

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.

Posted

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.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...