Cannot Process, Close MouseWithoutBorders.exe (windows/microsoft maybe store app)

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
sashaatx
Posts: 333
Joined: 27 May 2021, 08:27
Contact:

Cannot Process, Close MouseWithoutBorders.exe (windows/microsoft maybe store app)

Post by sashaatx » 16 Jan 2022, 19:18

very simple. Can open process, cannot close.

I've tried with/without quotations

Code: Select all

#Persistent


!k::
If ProcessExist("MouseWithoutBorders.exe")
{
Process, Close, MouseWithoutBorders.exe
}
Else
{ 
Run, C:\Program Files (x86)\Microsoft Garage\Mouse without Borders\MouseWithoutBorders.exe
    }

    
ProcessExist(Name){
    Process,Exist,%Name%
return Errorlevel
} 



~F2::Suspend
return

~Pause::
    Suspend,Off
    ExitApp
    




    #Persistent

!k::
Process Exist, MouseWithoutBorders.exe  
Process, Close, MouseWithoutBorders.exe  
Return
 



~F1::Suspend
return

~Ins::
    Suspend,Off
    ExitApp
    

User avatar
mikeyww
Posts: 26601
Joined: 09 Sep 2014, 18:38

Re: Cannot Process, Close MouseWithoutBorders.exe (windows/microsoft maybe store app)

Post by mikeyww » 16 Jan 2022, 19:21

Your script seems to do nothing because it generates an error message.

Code: Select all

EnvGet, pf86, ProgramFiles(x86)
mwb = MouseWithoutBorders.exe

!k::
Process, Exist, %mwb%
If ErrorLevel {                           ; Process exists
 RunWait, taskkill /im %mwb% /t /f,, Hide
 SoundBeep, 1000
} Else {                                  ; Process does not exist
 Run, %pf86%\Microsoft Garage\Mouse without Borders\%mwb%
 SoundBeep, 1500
}
Return

sashaatx
Posts: 333
Joined: 27 May 2021, 08:27
Contact:

Re: Cannot Process, Close MouseWithoutBorders.exe (windows/microsoft maybe store app)

Post by sashaatx » 16 Jan 2022, 21:53

Code: Select all

 #Persistent


!k::
If ProcessExist("MouseWithoutBorders.exe")
{
Process, Close, MouseWithoutBorders.exe
}
Else
{ 
Run, C:\Program Files (x86)\Microsoft Garage\Mouse without Borders\MouseWithoutBorders.exe
    }

    
ProcessExist(Name){
    Process,Exist,%Name%
return Errorlevel
} 



~F2::Suspend
return

~Pause::
    Suspend,Off
    ExitApp
    
###################

Code: Select all

    #Persistent

!k::
Process Exist, MouseWithoutBorders.exe  
Process, Close, MouseWithoutBorders.exe  
Return
 



~F1::Suspend
return

~Ins::
    Suspend,Off
    ExitApp


I accidentally sent a duplicate code with two copies or two versions smashed together.
I have separated them now.

I tried your code, if I should expect it to kill the app, and uploaded a video. No luck of it killing the process either.
Added msgbox instead of audio.
https://streamable.com/izroqi
https://github.com/samfisherirl
? /Easy-Auto-GUI-for-AHK-v2 ? /Useful-AHK-v2-Libraries-and-Classes : /Pulovers-Macro-Creator-for-AHKv2 :

User avatar
mikeyww
Posts: 26601
Joined: 09 Sep 2014, 18:38

Re: Cannot Process, Close MouseWithoutBorders.exe (windows/microsoft maybe store app)

Post by mikeyww » 16 Jan 2022, 22:20

OK. It worked here. I'm not sure what is happening at your end. My system information is below. You could try running as admin.

Operating system : Microsoft Windows 10 Pro
OS version : 10.0.19043
PC manufacturer : ASUSTeK COMPUTER INC.
PC model : ASUS EXPERTBOOK B9400CEAV_B9450CEA
CPU : Intel64 Family 6 Model 140 Stepping 1
CPU cores : 4
OS bitness : 64
CPU bitness : 64
BIOS manufacturer : ASUSTeK COMPUTER INC.
BIOS name : B9400CEAV.303
Motherboard manufacturer : ASUSTeK COMPUTER INC.
Motherboard product : B9400CEAV
Motherboard version : 1.0
AHK version : 1.1.33.10

sashaatx
Posts: 333
Joined: 27 May 2021, 08:27
Contact:

Re: Cannot Process, Close MouseWithoutBorders.exe (windows/microsoft maybe store app)

Post by sashaatx » 16 Jan 2022, 23:04

mikeyww wrote:
16 Jan 2022, 22:20
OK. It worked here. I'm not sure what is happening at your end. My system information is below. You could try running as admin.

Operating system : Microsoft Windows 10 Pro
OS version : 10.0.19043
PC manufacturer : ASUSTeK COMPUTER INC.
PC model : ASUS EXPERTBOOK B9400CEAV_B9450CEA
CPU : Intel64 Family 6 Model 140 Stepping 1
CPU cores : 4
OS bitness : 64
CPU bitness : 64
BIOS manufacturer : ASUSTeK COMPUTER INC.
BIOS name : B9400CEAV.303
Motherboard manufacturer : ASUSTeK COMPUTER INC.
Motherboard product : B9400CEAV
Motherboard version : 1.0
AHK version : 1.1.33.10
that worked. I haven't used close process prior so its new to me, but never had to run as admin for anything over 150 scripts. Interesting.. Is there a preferred way to set as admin on launch besides converting to exe and right click properties and settings as admin.
https://github.com/samfisherirl
? /Easy-Auto-GUI-for-AHK-v2 ? /Useful-AHK-v2-Libraries-and-Classes : /Pulovers-Macro-Creator-for-AHKv2 :


Post Reply

Return to “Ask for Help (v1)”