อยากปิดหน้าต่าง login
เมื่อเราใส่ไอดีและพาสแล้ว ให้หน้าต่างมันหายไปอ่ะคับ
#include
#include
#include
#include
#include
_Singleton(@ScriptName, 0)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Login", 195, 116, -1, -1)
$Label3 = GUICtrlCreateLabel("กรุณาใส่ User และ Pass",42, 5, 150, 21)
$UsernameEdit = GUICtrlCreateInput("", 38, 30, 150, 21, $GUI_SS_DEFAULT_INPUT)
$PasswordEdit = GUICtrlCreateInput("", 38, 60, 150, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_PASSWORD))
$ButtonOk = GUICtrlCreateButton("&OK", 55, 88, 65, 25, $BS_NOTIFY)
$ButtonCancel = GUICtrlCreateButton("&Cancel", 125, 88, 65, 25, $BS_NOTIFY)
#EndRegion ### END Koda GUI section ###
Global $onoff = 0
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $ButtonCancel
$verify = MsgBox(0, "EXIT", " ปิดโปรแกรม")
Exit
Case $ButtonOk
check()
EndSwitch
WEnd
Func check()
If GUICtrlRead($UsernameEdit) = "a" And GUICtrlRead($PasswordEdit) = "a" Then
start()
ElseIf GUICtrlRead($UsernameEdit) = "abc" And GUICtrlRead($PasswordEdit) = "123" Then
start()
ElseIf GUICtrlRead($UsernameEdit) = "def" And GUICtrlRead($PasswordEdit) = "456" Then
start()
Else
$verify = MsgBox(4, "Login ", " ตวรวจสอบ user pass ")
EndIf
EndFunc
Func Start()
If $onoff = 0 Then
$onoff = 1
Run("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe")
EndIf
EndFunc
เมื่อเราใส่ไอดีและพาสแล้ว ให้หน้าต่างมันหายไปอ่ะคับ
#include
#include
#include
#include
#include
_Singleton(@ScriptName, 0)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Login", 195, 116, -1, -1)
$Label3 = GUICtrlCreateLabel("กรุณาใส่ User และ Pass",42, 5, 150, 21)
$UsernameEdit = GUICtrlCreateInput("", 38, 30, 150, 21, $GUI_SS_DEFAULT_INPUT)
$PasswordEdit = GUICtrlCreateInput("", 38, 60, 150, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_PASSWORD))
$ButtonOk = GUICtrlCreateButton("&OK", 55, 88, 65, 25, $BS_NOTIFY)
$ButtonCancel = GUICtrlCreateButton("&Cancel", 125, 88, 65, 25, $BS_NOTIFY)
#EndRegion ### END Koda GUI section ###
Global $onoff = 0
GUISetState()
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $ButtonCancel
$verify = MsgBox(0, "EXIT", " ปิดโปรแกรม")
Exit
Case $ButtonOk
check()
EndSwitch
WEnd
Func check()
If GUICtrlRead($UsernameEdit) = "a" And GUICtrlRead($PasswordEdit) = "a" Then
start()
ElseIf GUICtrlRead($UsernameEdit) = "abc" And GUICtrlRead($PasswordEdit) = "123" Then
start()
ElseIf GUICtrlRead($UsernameEdit) = "def" And GUICtrlRead($PasswordEdit) = "456" Then
start()
Else
$verify = MsgBox(4, "Login ", " ตวรวจสอบ user pass ")
EndIf
EndFunc
Func Start()
If $onoff = 0 Then
$onoff = 1
Run("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe")
EndIf
EndFunc