Jump to content

ISO: "Close Group" like code


Recommended Posts

Using WinXP I have my Taskbar and Start Menu Properties set to "Group similar taskbar buttons". If I right click a group I can select "Close Group" from the shortcut menu. This closes all the windows under this button group very quickly. I've searched the forum for a similar topic with not avail. Using WinClose() or WinKill() does the job, but not nearly as fast as Window's Close Group. ProcessClose() only seems to close one of the processes then exits the script without any errors, despite being in a For...Next loop.

Here's an example of what I'm talking about:

Opt("WinTitleMatchMode", 4)

HotKeySet("{ESC}", "_Quit")

For $n = 1 To 10
    Run("calc.exe")
    Sleep(100)
    ControlFocus("Calculator", "", "[ClassNN:Edit1]")
    ControlSend("", "", "[ClassNN:Edit1]", $n)
Next

Global $avWinList = WinList("[CLASS:SciCalc]")

While 1
    Sleep(40)
WEnd

Func _Quit()
    For $n = 1 To $avWinList[0][0]
        WinKill($avWinList[$n][1])
        ;; WinClose($avWinList[$n][1])
        ;; WinWaitClose($avWinList[$n][1])
    Next
    Exit
EndFunc   ;==>_Quit

Any suggestions on code that would emulate the speed of "Close Group" would be greatly apprecited!

Link to comment
Share on other sites

Using WinXP I have my Taskbar and Start Menu Properties set to "Group similar taskbar buttons". If I right click a group I can select "Close Group" from the shortcut menu. This closes all the windows under this button group very quickly. I've searched the forum for a similar topic with not avail. Using WinClose() or WinKill() does the job, but not nearly as fast as Window's Close Group. ProcessClose() only seems to close one of the processes then exits the script without any errors, despite being in a For...Next loop.

Nevermind... When I first tried ProcessClose() I didn't read the example. This does what I was looking for. Thanks anyways!

FROM

Func _Quit()
    For $n = 1 To $avWinList[0][0]
        WinKill($avWinList[$n][1])
        ;; WinClose($avWinList[$n][1])
        ;; WinWaitClose($avWinList[$n][1])
    Next
    Exit
EndFunc   ;==>_QuitoÝ÷ Ù3ºÚ"µÍ[ÈÔ]Z]

BQÜ    ÌÍÛHHÈ  ÌÍØ]Ú[ÝÌVÌBBIÌÍÔQHØÙÜÑ^ÝÊ   ][ÝØØ[Ë^I][ÝÊHÈÚ[]HQÜYHØÙÜÈÛÌÎNÝÝ[BRY ÌÍÔQ[ØÙÜÐÛÜÙJ ÌÍÔQ
BS^Q^][[ÈÏOIÝ×Ô]Z]
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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