Jump to content
Sign in to follow this  
darksupernova

Terminate with operator key

Recommended Posts

darksupernova

Hello again!

I would like to use the follow script, except I would like to add an operator script. eg use ALT-ESC but I dont know how to code this in?

I would also like this script to run two programs and then terminate both with the same key combination, is this easily done?

HotKeySet("{ESC}", "Terminate")
If $CmdLine[0] == 1 Then
ProcessClose ( "XBMC.exe" )
Run ( '"H:\remotedesktop.exe" /e "' & $CmdLine[1] & '"', "H:\" )
While 1
Sleep(100)
WEnd
EndIf
Func Terminate()
ProcessClose ( "remotedesktop.exe" )
Run ( '"H:\Interface\xbmc\XBMC.exe"' )
WinWait ( "XBMC" )
WinActivate ( "XBMC" )
Exit 0
EndFunc

Thanks for your help!

Updated!

Edited by darksupernova

Share this post


Link to post
Share on other sites
Kyan

XBMC is a media center, dolphin could be a screen saver, idk. But if you think is game related better remove my 1st comment


Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Share this post


Link to post
Share on other sites
Melba23

DiOgO,

if you think is game related

We do. ;)

better remove my 1st comment

There is an "Edit" button on the post for you to do it yourself. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
darksupernova

I'm sorry, Im not actually using this for anything game related, I'm just copying a script from somewhere as I have no coding experience! This is what came up on google when I was trying to learn how to terminate something and run something else. I actually want to use it to launch the remote desktop program from within xbmc.

Sorry for the confusion!

Share this post


Link to post
Share on other sites
Kyan

DiOgO,

There is an "Edit" button on the post for you to do it yourself. ;)

M23

Done :) (I thought that is only possible edit a comment until 2-5min after being published)

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Share this post


Link to post
Share on other sites
darksupernova

So why doesnt this work?

HotKeySet("{ALT}+{ESC}", "Terminate")
If $CmdLine[0] == 1 Then
ProcessClose ( "XBMC.exe" )
Run ( '"H:\remotedesktop.exe" /e "' & $CmdLine[1] & '"', "H:\" )
While 1
Sleep(100)
WEnd
EndIf
Func Terminate()
ProcessClose ( "remotedesktop.exe" )
Run ( '"H:\Interface\xbmc\XBMC.exe"' )
WinWait ( "XBMC" )
WinActivate ( "XBMC" )
Exit 0
EndFunc

Share this post


Link to post
Share on other sites
Jos

You were expected to answer my question.

*click*

Reopened after having received a pm.

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
darksupernova

Nobody can help me add in the use of an operator key?

Share this post


Link to post
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
Sign in to follow this  

×