If you enter 1 in card0~3 respectively and then press password 1, you will see the data stored in C:\Users\User\Desktop\123\1.txt, this is correct.
But when I enter 1 in card0~3 respectively and then press the wrong password 2, the test window will be close.
Code: Select all
Gui, Add, Button, x170 y20 , &Lock
Gui, Add, Button, x+100 yp , &Unlock
Gui, Add, Edit , x10 y+20 w500 h100 vcard0
Gui, Add, Edit , x10 y+20 w500 h100 vcard1
Gui, Add, Edit , x10 y+20 w500 h100 vcard2
Gui, Add, Edit , x400 y20 w100 h20 vcard3
Gui, Add, DateTime, x30 y10 w105 h40 vcard7, MM/dd/yyyy
Gui, Show,, Test
log = C:\Users\User\Desktop\123\%card3%.txt
ButtonLock:
GuiControl, % (A_GuiControl = "&Lock" ? "+" : "-") "ReadOnly", card0
GuiControl, Focus, card0
GuiControl, % (A_GuiControl = "&Lock" ? "+" : "-") "ReadOnly", card1
GuiControl, Focus, card1
GuiControl, % (A_GuiControl = "&Lock" ? "+" : "-") "ReadOnly", card2
GuiControl, Focus, card2
GuiControl, Enable, card7
GuiControl, Focus, card7
Return
ButtonUnlock:
GuiControl, % (A_GuiControl = "&Lock" ? "+" : "-") "ReadOnly", card0
GuiControl, Focus, card0
GuiControl, % (A_GuiControl = "&Lock" ? "+" : "-") "ReadOnly", card1
GuiControl, Focus, card1
GuiControl, % (A_GuiControl = "&Lock" ? "+" : "-") "ReadOnly", card2
GuiControl, Focus, card2
GuiControl, Disable, card7
GuiControl, Focus, card7
Return
GuiClose:
#NoTrayIcon
Gui +OwnDialogs
InputBox, Password , Enter Password, Please input the correct password, hide, 250, 125, 300, 300
Gui, Submit
if Password = 1
{
FileAppend, %A_ComputerName% `n Window_1:%card0% `n Window_2:%card1% `n Window_3:%card2% `n%card7%, C:\Users\User\Desktop\123\%card3%.txt
MSGBOX, %A_ComputerName% `n Window_1:%card0% `n Window_2:%card1% `n Window_3:%card2% `n%card7%
ExitApp
}
else
MSGBOX, An incorrect password!!!
return