MrTheDzam

Test ghi file TXT

Sep 25th, 2015
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.98 KB | None | 0 0
  1. #include <EditConstants.au3>
  2. #include <GUIConstantsEx.au3>
  3. #include <GuiStatusBar.au3>
  4. #include <StaticConstants.au3>
  5. #include <WindowsConstants.au3>
  6.  
  7. ;Option
  8. Opt('GuiOnEventMode', 1)
  9.  
  10. Global $Form1 = GUICreate("Test Ghi File TXT", 404, 157, 192, 124)
  11. GUISetOnEvent($GUI_EVENT_CLOSE, 'MainFormClose')
  12. GUISetFont(15, 400, 0, "Tahoma")
  13. Global $Input1 = GUICtrlCreateInput("", 32, 80, 329, 32)
  14. Global $Label1 = GUICtrlCreateLabel("Type something in here, then press Enter", 16, 16, 373, 28)
  15. Global $StatusBar1 = _GUICtrlStatusBar_Create($Form1)
  16. _GUICtrlStatusBar_SetText($StatusBar1, 'Coded by MrTheDzam')
  17. HotKeySet('{ENTER}', '_SaveFile')
  18. GUISetState(@SW_SHOW)
  19.  
  20.  
  21. While 1
  22.     Sleep(69)
  23. WEnd
  24.  
  25. Func MainFormClose()
  26.     Exit
  27. EndFunc
  28.  
  29. Func _SaveFile()
  30.     Local $data = GUICtrlRead($Input1)
  31.     FileWrite('demo.txt', $data)
  32.     If MsgBox(64 + 262144 + 1, 'Message', 'Đã ghi xong! Bạn có muốn xem nội dung vừa ghi không?') == 1 then
  33.         ShellExecute('demo.txt')
  34.     EndIf
  35.  
  36. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment