Super-ilad
Super-ilad

Reputation: 101

Is there any way to ban from closing AHK back-end program?

My child sometimes would play game, i want to control that,so i set AHK to detect game play , well , he is smart and know how to close it ,like below image , close the AHK icon:

example

i wonder is there any way to ban from closing AHK file ? or in another word, close it through a password,only i can know that password.

in one words,lock any modify to AHK program thoroughly.

i have come up with the idea to set a higher user to lock that close or change,but i think it may be fruitless

Thanks if you know how to lock that modify.

---------------BTW------------------

(i tried to code a C++ back-end exe file ,but he also know how to close it in the task manager.

i have also tried a back-end screenshot exe by python , but he also know how to close it.)

Upvotes: 0

Views: 108

Answers (2)

Yane
Yane

Reputation: 837

Here's a solution using the Menu command to remove the default menu items.

password := "secret"
Menu, Tray, NoStandard
Menu, Tray, Add , Exit, MyExit

.
.
.

MyExit:
InputBox, password_input, Enter password, Enter password, HIDE
If (password_input == password)
{
    ExitApp
}
else
{
    Msgbox,% "Wrong password"
}
return

Upvotes: 2

lintalist
lintalist

Reputation: 383

Look at the OnExit function, if the script is closed you can catch the event and only actually close it when a password is given, if the password is incorrect the script is simply kept running.

Upvotes: 1

Related Questions