Application tag {CLOSE} or {KILL} ?

x64 Replacement/Alternative to Microsoft's IntelliMouse application.
Forum rules
Please read the forum rules before posting for the first time.
The more information you can provide, the quicker and more accurately someone can help.
NOTE: To reduce spam, new users can not post links, files or images until they have at least 4 posts.
Post Reply
Lores
Dedicated
Posts: 63
Joined: Mon Jan 23, 2023 11:58 pm

Application tag {CLOSE} or {KILL} ?

Post by Lores »

When adding Simulated Keystrokes I can scroll down through syntax / info. And there is this Application tags section listing

Code: Select all

{RUN:<application>} {RUN:<full path to exe>}

What about is counterpart - i.e. something like

Code: Select all

{KILLPROCESS:<application>}
and / or

Code: Select all

{CLOSE:<full path to exe>}
?


How can I close a program with my mouse using X-Mouse Button Control?
Last edited by Lores on Sun Feb 05, 2023 4:35 pm, edited 1 time in total.
User avatar
phil
Site Admin
Posts: 7670
Joined: Sun Apr 06, 2003 11:12 pm

Re: Application tag {CLOSE} or {KILL} ?

Post by phil »

There is no tag to do this currently. I can add it to the todo list...
You could create a script/batch file using taskkill and then run that script using the run command I guess (but it seems the run command does not allow command line arguments (thats a shame, otherwise you could have done {run:taskkill.exe /im notepad.exe})
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
Lores
Dedicated
Posts: 63
Joined: Mon Jan 23, 2023 11:58 pm

Re: Application tag {CLOSE} or {KILL} ?

Post by Lores »

So this works

Code: Select all

cmd /C taskkill /IM notepad.exe /T /F
when a user writes this in already opened window od Command Line. But this

Code: Select all

C:\Windows\system32\cmd.exe /C taskkill /IM notepad.exe /T /F
or this

Code: Select all

run C:\Windows\system32\cmd.exe /C taskkill /IM notepad.exe /T /F
does not work when written in the Run Application box. But this version does work:

Code: Select all

C:\Windows\system32\cmd.exe "/C taskkill /IM notepad.exe /T /F"
So this above is a working workaround, which does not even require creation of a BAT file with according code or LNK with its Target bearing it - but coming up with it required some knowledge


And thus I think you should add to your program an option for selecting a path to a program this is to be closed with a user chosen mouse hothkey
Lores
Dedicated
Posts: 63
Joined: Mon Jan 23, 2023 11:58 pm

Re: Application tag {CLOSE} or {KILL} ?

Post by Lores »

So this works

Code: Select all

cmd /C taskkill /IM notepad.exe /T /F
when a user writes this in already opened window od Command Line. But this

Code: Select all

C:\Windows\system32\cmd.exe /C taskkill /IM notepad.exe /T /F
or this

Code: Select all

run C:\Windows\system32\cmd.exe /C taskkill /IM notepad.exe /T /F
does not work when written in the Run Application box. But this version does work:

Code: Select all

C:\Windows\system32\cmd.exe "/C taskkill /IM notepad.exe /T /F"
So this above is a working workaround, which does not even require creation of a BAT file with according code or LNK with its Target bearing it - but coming up with it required some knowledge


And thus I think you should add to your program an option for selecting a path to a program this is to be closed with a user chosen mouse hotkey
User avatar
phil
Site Admin
Posts: 7670
Joined: Sun Apr 06, 2003 11:12 pm

Re: Application tag {CLOSE} or {KILL} ?

Post by phil »

I'll add it to the list, but there will be several caveats, for instance, if you have multiple notepads open (maybe different users in different logged on sessions too), I expect it will kill all of them? I guess that's not a major concern but something to consider. I don't believe the path is particularly useful (taskkill does not use the path, just the image name (exe)) so if you had two programs with the same image name, in different folders, it probably wont be able to choose between them.

Curious what you are trying to close/kill - I guess its not the active window, else why not just use {ALT}{F4} or Close Window or such like?
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
Lores
Dedicated
Posts: 63
Joined: Mon Jan 23, 2023 11:58 pm

Re: Application tag {CLOSE} or {KILL} ?

Post by Lores »

My curren dealings are with Microsoft Screen Magnifier [although all of this I can now extrapolate for other programs]

And yes, you had already added a ready to use option for toggling it ON / OFF, but it not the same as keeping them separate. And turning it ON it does not work quite the same like in HotkeyP- although I suspect that in HotkeyP I experience a bug; which I use to my advantage

[And by evoking HotkeyP I am not trying to diminish your work - as all in all I am trying to do is to come up with an optimal settings for my Windows, one way or another, i.e. using Autohotkey, X-MBC and or / HotkeyP, my programmable portable keyboard and whatever tool next I will get to know]
Post Reply