Jump to content

EditBox Display


Giggo
 Share

Recommended Posts

Hello!

I would like to view the content inside an edibox

code:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <InetConstants.au3>

#Region ### START Koda GUI section ### Form=Form1.kxf
$Form1 = GUICreate("Form1", 601, 417, 192, 124)
$edit1 = GUICtrlCreateEdit("", 0, 133, 601, 300) ; content youtube_dl -h
;$Input1 = GUICtrlCreateInput("", 0, 5, 601, 21) ; 
$Button1 = GUICtrlCreateButton("Run", 264, 69, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

If FileExists("youtube-dl.exe") Then
Else
    Local $dl = InetGet("http://yt-dl.org/downloads/latest/youtube-dl.exe", "youtube-dl.exe", 1, 1)
    InetClose($dl)
EndIf

Local $param = " -h" ;h params show info youtube-dl
Local $exe = "\youtube-dl.exe" 
Local $ytdm = @ScriptDir & $exe & $param

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

Case $Button1
RunWait ($ytdm, "", @SW_SHOW)
    EndSwitch
WEnd

 

Link to comment
Share on other sites

51 minutes ago, ad777 said:

use GuiCtrlRead.ex see below:

GuiCtrlRead($edit1)

 

mmhh..

me solution is

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <InetConstants.au3>
#include <AutoItConstants.au3>


Global $iPID = -1
Local $param = " -h" ;h params show info youtube-dl
Local $exe = "\youtube-dl.exe" 
Local $ytdm = @ScriptDir & $exe & $param
Local $sCommand
Global Const $EMPTY_STRING = ""

#Region ### START Koda GUI section ### Form=Form1.kxf
$Form1 = GUICreate("Form1", 601, 417, 192, 124)
$edit1 = GUICtrlCreateEdit($EMPTY_STRING, 0, 133, 601, 300, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_READONLY, $WS_HSCROLL, $WS_VSCROLL, $WS_CLIPSIBLINGS))
;$Input1 = GUICtrlCreateInput("", 0, 5, 601, 21) ; 
$Button1 = GUICtrlCreateButton("Run", 264, 69, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

If FileExists("youtube-dl.exe") Then
Else
    Local $dl = InetGet("http://yt-dl.org/downloads/latest/youtube-dl.exe", "youtube-dl.exe", 1, 1)
    InetClose($dl)
EndIf


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

Case $Button1
    $iPID = Run($ytdm,"", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
    GUICtrlSetData($edit1, $EMPTY_STRING)
    While 1
        $sOutput = StdoutRead($iPID)
        If @error Then ExitLoop
        If $sOutput <> $EMPTY_STRING Then
            If StringInStr($sOutput,"") > 1 Then
                GUICtrlSetData($edit1, $sOutput)
            Else
                GUICtrlSetData($edit1, GUICtrlRead($edit1) & $sOutput)
            EndIf
        EndIf
        $sOutput = StderrRead($iPID)
        If @error Then ExitLoop
        If $sOutput <> $EMPTY_STRING Then GUICtrlSetData($edit1, GUICtrlRead($edit1) & $sOutput)
    WEnd
    EndSwitch
WEnd

 

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...