radboi22 Posted April 9, 2008 Share Posted April 9, 2008 Hi, Im new to AUTOIT obviously, I was wondering if anyone would Depart some information on how to put a Text file into the GUI, And will it update in REAL TIME as information is added to this file? Basically, I want the text from a notepad file to show on the GUI, And update in real time. Also the program im working with has A Remote option, IP/PORT, how do I Manipulate this, and how can I draw information from this? (Parsing, etc...) THANK YOU =D Link to comment Share on other sites More sharing options...
rasim Posted April 9, 2008 Share Posted April 9, 2008 (edited) Hi, Im new to AUTOIT obviously, I was wondering if anyone would Depart some information on how to put a Text file into the GUI, And will it update in REAL TIME as information is added to this file? Basically, I want the text from a notepad file to show on the GUI, And update in real time. Try this: #include <GuiConstants.au3> Global $ReadNotepad, $ReadEdit $hGUI = GUICreate("MainGUI", 300, 200, 0, 0) $hEdit = GUICtrlCreateEdit("", 10, 10, 280, 180, BitOR($ES_WANTRETURN, $WS_VSCROLL)) GUISetState() Run("notepad.exe") WinWait("[Class:Notepad]") $hWnd = WinGetHandle("[Class:Notepad]") ConsoleWrite($hWnd & @LF) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch $ReadNotepad = ControlGetText($hWnd, "", "Edit1") $ReadEdit = GUICtrlRead($hEdit) If ($ReadNotepad <> "") And ($ReadNotepad <> $ReadEdit) Then GUICtrlSetData($hEdit, $ReadNotepad) WEnd Edited April 9, 2008 by rasim Link to comment Share on other sites More sharing options...
radboi22 Posted April 9, 2008 Author Share Posted April 9, 2008 Try this: #include <GuiConstants.au3> Global $ReadNotepad, $ReadEdit $hGUI = GUICreate("MainGUI", 300, 200, 0, 0) $hEdit = GUICtrlCreateEdit("", 10, 10, 280, 180, BitOR($ES_WANTRETURN, $WS_VSCROLL)) GUISetState() Run("notepad.exe") WinWait("[Class:Notepad]") $hWnd = WinGetHandle("[Class:Notepad]") ConsoleWrite($hWnd & @LF) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch $ReadNotepad = ControlGetText($hWnd, "", "Edit1") $ReadEdit = GUICtrlRead($hEdit) If ($ReadNotepad <> "") And ($ReadNotepad <> $ReadEdit) Then GUICtrlSetData($hEdit, $ReadNotepad) WEnd Kewl ty =D Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now