Jump to content

Terminate with operator key


Recommended Posts

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Developers

You were expected to answer my question.

*click*

Reopened after having received a pm.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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