Jump to content

Console Write To Gui Or To Txt File


Recommended Posts

Hello Brothers , I came Again with Another Hard thing To Learn :)

Please Follow Example :
ConsoleWrite(" I want output this " )

What I want is Someway to read All the ConsoleWrite Outputs

Local $link = _INetGetSource('https://raw.githubusercontent.com/abdulrahmanok/Version/master/LatestVersionLink')

    Local $hDownload = InetGet($link, @ScriptDir & "\CaleUpdate.exe", Default, $INET_DOWNLOADBACKGROUND)
    ; Wait for the download to complete by monitoring when the 2nd index value of InetGetInfo returns True.
    Do
        $ArrayOFDownloadStatuts = InetGetInfo($hDownload)

        ConsoleWrite("currently downloaded " & Round($ArrayOFDownloadStatuts[0] / 2 ^ 10) & " KB" & @CRLF)
        ConsoleWrite("Total Size " & Round($ArrayOFDownloadStatuts[1] / 2 ^ 20, 2) & " MB" & @CRLF)

        Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    Global $file = @ScriptDir & "\Version.txt"
    FileWrite($file,$versionCheck&@CRLF)
    Run(@ScriptDir & "\CaleUpdate.exe")
EndFunc   ;==>checkupdate

Because I want To Output :

ConsoleWrite("currently downloaded " & Round($ArrayOFDownloadStatuts[0] / 2 ^ 10) & " KB" & @CRLF)
        ConsoleWrite("Total Size " & Round($ArrayOFDownloadStatuts[1] / 2 ^ 20, 2) & " MB" & @CRLF)

To make User Know what is download Data .
Solved by Another Way : Thank You all guys For Your efforts. o:)

 

Edited by abdulrahmanok
Link to comment
Share on other sites

2 minutes ago, l3ill said:

So you want the user to see what you see in the console?

Have a look at Toast in M23's sig...

He also has another tool like that that shows messages on the screen edge.

yes i want this , but I didn't understand about M23's............................

Link to comment
Share on other sites

A much simpler method (but missing some bells and whistles):

TrayTip

#include <TrayConstants.au3>

Run("notepad.exe")

$hWnd = WinWait("[CLASS:Notepad]")
If WinExists($hWnd) Then
;~ MsgBox(0, "", "")
TrayTip("", "Notepad Succesfully Started", 5)
Sleep(5000)

EndIf

 

Link to comment
Share on other sites

51 minutes ago, l3ill said:

A much simpler method (but missing some bells and whistles):

TrayTip

#include <TrayConstants.au3>

Run("notepad.exe")

$hWnd = WinWait("[CLASS:Notepad]")
If WinExists($hWnd) Then
;~ MsgBox(0, "", "")
TrayTip("", "Notepad Succesfully Started", 5)
Sleep(5000)

EndIf

 

I don't understand what your code exactly for , it even not has "ConsoleWrite"

Link to comment
Share on other sites

Your output to the console can be part of your GUI, just make a label for it, and update it as needed.

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

13 minutes ago, l3ill said:
;~ $asd=ConsoleWrite("Its just try")
$asd ="Its just try"
msgbox(0, $asd, $asd)

 

I Noticed Another Solution from this reply :

Func checkupdate()
    
    Local $link = _INetGetSource('https://github.com/abdulrahmanok/Version/raw/master/LatestVersionLink')

    Local $hDownload = InetGet($link, @ScriptDir & "\CaleUpdate.exe", Default, $INET_DOWNLOADBACKGROUND)
    ; Wait for the download to complete by monitoring when the 2nd index value of InetGetInfo returns True.
    
    Do
        
        $ArrayOFDownloadStatuts = InetGetInfo($hDownload)
$currentlydownloaded=Round($ArrayOFDownloadStatuts[0] / 2 ^ 10) & " KB" & @CRLF
    $TotalSize=  Round($ArrayOFDownloadStatuts[1] / 2 ^ 20, 2) & " MB" & @CRLF
    SplashTextOn("Download Update" ,$currentlydownloaded&@CRLF&"Out OF "&$TotalSize)
        ;ConsoleWrite("currently downloaded " & Round($ArrayOFDownloadStatuts[0] / 2 ^ 10) & " KB" & @CRLF)
    ;consoleWrite("TotalSize " & Round($ArrayOFDownloadStatuts[1] / 2 ^ 20, 2) & " MB" & @CRLF)
        Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
    $hFO = FileOpen(@ScriptDir & "\Version.txt", 2)
        FileWrite($hFO, $versionCheck&@CRLF)
        FileClose($hFO)
    Run(@ScriptDir & "\CaleUpdate.exe")
    Exit
EndFunc   ;==>checkupdate

Now I'm using "SplashTextON" To Get CurrentlyDownload And TotalSize but the problem is This splash screen Between (Do and Until) loop so its fade in ( show and hide many times ) is there is any solution to this ?

Link to comment
Share on other sites

6 minutes ago, l3ill said:

o:) If you really wanna stretch your horizons have a look at the Progress functions in the same folder as Splash. :evil:

I Did , I learned how  Toast_Example.au3 Progress working but i didn't add it because its increase my program Memory size processes :)

My program Current memory size is above 45000

Edited by abdulrahmanok
Link to comment
Share on other sites

41 minutes ago, abdulrahmanok said:

I Already have Label But Cant get consolewrite value into it  For Example :
 

$asd=ConsoleWrite("Its just try")
msgbox(0, $asd,asd)

always empty msgbox

Use this for your label or create a variable out of this data to be used:

Round($ArrayOFDownloadStatuts[0] / 2 ^ 10) & " KB"

 

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Link to comment
Share on other sites

15 minutes ago, nitekram said:

Use this for your label or create a variable out of this data to be used:

Round($ArrayOFDownloadStatuts[0] / 2 ^ 10) & " KB"

 

Finally Worked But with TextBox because Label has Some strange problems Final code :
 

Do
            $ArrayOFDownloadStatuts = InetGetInfo($hDownload)
            $currentlydownloaded=Round($ArrayOFDownloadStatuts[0] / 2 ^ 10) & " KB" & @CRLF
    $TotalSize=  Round($ArrayOFDownloadStatuts[1] / 2 ^ 20, 2) & " MB" & @CRLF
    $readvalue=    $currentlydownloaded&@CRLF&"Out OF "&$TotalSize
        

    $try1 = ControlSetText("", "", $try, $readvalue)  ;try is my  Gui Text

;~ TrayTip ("Download Progress" ,$currentlydownloaded&@CRLF&"Out OF "&$TotalSize,2000)
;~         ;ConsoleWrite("currently downloaded " & Round($ArrayOFDownloadStatuts[0] / 2 ^ 10) & " KB" & @CRLF)
;~     ;consoleWrite("TotalSize " & Round($ArrayOFDownloadStatuts[1] / 2 ^ 20, 2) & " MB" & @CRLF)
;~         Sleep(250)
    Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)

 

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