View previous topic :: View next topic |
Author |
Message |
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Mon Jan 16, 2017 12:06 am Post subject: checkbox logic (to close app when checkbox unchecked) |
|
|
Hi there,
Code: | function proApp(sender)
if TrainerOrigin~=nil then
path=TrainerOrigin
else
path=getCheatEngineDir()
end
if string.sub(path,#path, #path)~="\\" then
path=path.."\\"
end
shellExecute(path.."1by1.exe")
if sender.unChecked then
autoAssemble[[alloc(p,64)
createthread(p)
p:
push 0
call exitProcess
ret]]
end
end
UDF1.CECheckbox1.onChange = proApp
|
1. When checkbox checked, it execute "1x1.exe"
2. When checkbox unchecked, it execute "1x1.exe" again
How to close "1x1.exe" when checkox unchecked ?
Thank and regards
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Mon Jan 16, 2017 12:48 am Post subject: |
|
|
Code: | shellExecute("taskkill", "/IM 1x1.exe /F") |
|
|
Back to top |
|
|
panraven Grandmaster Cheater Reputation: 55
Joined: 01 Oct 2008 Posts: 942
|
Posted: Mon Jan 16, 2017 12:55 am Post subject: |
|
|
There should be no .unChecked property.
Try check .Checked or .State vs cbGrayed etc.
btw, closing application externally may not allow a chance for the application properly exit, eg. lost of game progress.
bye~
_________________
- Retarded. |
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Mon Jan 16, 2017 2:33 am Post subject: |
|
|
Ok, thanks both of you Zanzer and panraven
SOLVED :
Code: | function proApp(sender)
if TrainerOrigin~=nil then
path=TrainerOrigin
else
path=getCheatEngineDir()
end
if string.sub(path,#path, #path)~="\\" then
path=path.."\\"
end
boxstate = checkbox_getState(UDF1.CECheckbox1)
if boxstate == 1 then
shellExecute(path.."1by1.exe")
elseif boxstate == 0 then
shellExecute("taskkill", "/IM 1by1.exe /F")
end
end
UDF1.CECheckbox1.onChange = proApp |
regards
|
|
Back to top |
|
|
|