Jump to content

Adding a text file to the GUI?


Recommended Posts

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

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 by rasim
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...