Jump to content

Recommended Posts

Posted

Hey guys, I'm looking to close multiple windows (not kill any processes) depending on whether my laptop is connected to my NAS or not. I've tried 2 different approaches, but neither work:

if WinExists("Razer Synapse") Then
WinClose("Razer Synapse", "MSI Afterburner")
ElseIf WinExists("AEC (ASUSTOR EZ Connect)") Then
WinClose("AEC (ASUSTOR EZ Connect)")
EndIf

 

if WinExists("Razer Synapse") Then
WinClose("Razer Synapse")
WinClose("MSI Afterburner")
ElseIf WinExists("AEC (ASUSTOR EZ Connect)") Then
WinClose("AEC (ASUSTOR EZ Connect)")
EndIf

 

What am I doing wrong?

Posted (edited)

put some Console Write as a check point, to see if it finds the windows
 

If WinExists("Razer Synapse") Then
    ConsoleWrite("WinExists: Razer Synapse" & @CRLF)
    WinClose("Razer Synapse")
    WinClose("MSI Afterburner")
EndIf

If WinExists("AEC (ASUSTOR EZ Connect)") Then
    ConsoleWrite("WinExists: AEC (ASUSTOR EZ Connect)" & @CRLF)
    WinClose("AEC (ASUSTOR EZ Connect)")
EndIf


:welcome: to forum
how-to-post-code-on-the-forum

Edited by ioa747

I know that I know nothing

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...