Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <GuiStatusBar.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- ;Option
- Opt('GuiOnEventMode', 1)
- Global $Form1 = GUICreate("Test Ghi File TXT", 404, 157, 192, 124)
- GUISetOnEvent($GUI_EVENT_CLOSE, 'MainFormClose')
- GUISetFont(15, 400, 0, "Tahoma")
- Global $Input1 = GUICtrlCreateInput("", 32, 80, 329, 32)
- Global $Label1 = GUICtrlCreateLabel("Type something in here, then press Enter", 16, 16, 373, 28)
- Global $StatusBar1 = _GUICtrlStatusBar_Create($Form1)
- _GUICtrlStatusBar_SetText($StatusBar1, 'Coded by MrTheDzam')
- HotKeySet('{ENTER}', '_SaveFile')
- GUISetState(@SW_SHOW)
- While 1
- Sleep(69)
- WEnd
- Func MainFormClose()
- Exit
- EndFunc
- Func _SaveFile()
- Local $data = GUICtrlRead($Input1)
- FileWrite('demo.txt', $data)
- If MsgBox(64 + 262144 + 1, 'Message', 'Đã ghi xong! Bạn có muốn xem nội dung vừa ghi không?') == 1 then
- ShellExecute('demo.txt')
- EndIf
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment