Sign in to follow this  
Followers 0
d4rk

repeat ...

5 posts in this topic

2, i've written a program with loop inside, there's one hot key which stop the whole program when i press it, and i wonder how to restart the program by another hotkey ?

please give me some advice, thx


[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites



Chris, what you just wrote there is garbage and all you will do is pile up Main functions on the stack.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

2, i've written a program with loop inside, there's one hot key which stop the whole program when i press it, and i wonder how to restart the program by another hotkey ?

please give me some advice, thx

You could have another compiled script which runs in the background. Keep the hotkey to end your program, but have another hotkey in the background program to run your program. Something like this maybe. (This assumes that you are running your script compiled.)

HotKeySet("!+s","startup");start your program if needed
HotKeySet("!+q","quit"); stop this 'background' program
While 1
    Sleep(50)
WEnd

Func startup()
    If Not ProcessExists("myApp.exe") Then Execute("MyApp.exe")
EndFunc

Func quit()
    Exit
    
EndFunc
Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

You could have another compiled script which runs in the background. Keep the hotkey to end your program, but have another hotkey in the background program to run your program. Something like this maybe. (This assumes that you are running your script compiled.)

HotKeySet("!+s","startup");start your program if needed
HotKeySet("!+q","quit"); stop this 'background' program
While 1
    Sleep(50)
WEnd

Func startup()
    If Not ProcessExists("myApp.exe") Then Execute("MyApp.exe")
EndFunc

Func quit()
    Exit
    
EndFunc
Thanks all, :) but i think martin has met my aim , thanks again guys Edited by d4rk

[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

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  
Followers 0