06-16-2020, 07:44 AM
Using curl.exe I wanted to know if it is possible to show the realtime output of the curl.exe command.
Below I used "ExeOutputControl" and wanted to show the realtime output in the below rich edit control.
The below code works, execept the realtime output part. It only shows the command line output after the download is finished.
Is it possible?
Function curl_output_test
Below I used "ExeOutputControl" and wanted to show the realtime output in the below rich edit control.
The below code works, execept the realtime output part. It only shows the command line output after the download is finished.
Is it possible?
Function curl_output_test
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 572 194 "Dialog"
;3 Button 0x54032000 0x0 5 17 48 14 "start"
;4 Edit 0x54030080 0x200 57 18 512 12 ""
;5 RichEdit20A 0x54233044 0x200 5 44 562 149 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2040601 "*" "" "" ""
;; SELECT ANOTHER TESTFILE IF NEEDED:
;str url="http://ipv4.download.thinkbroadband.com/5MB.zip"
;str url="http://ipv4.download.thinkbroadband.com/10MB.zip"
;str url="http://ipv4.download.thinkbroadband.com/20MB.zip"
;str url="http://ipv4.download.thinkbroadband.com/50MB.zip"
;str url="http://ipv4.download.thinkbroadband.com/100MB.zip"
str url="http://ipv4.download.thinkbroadband.com/200MB.zip"
;str url="http://ipv4.download.thinkbroadband.com/512MB.zip"
;str url="http://ipv4.download.thinkbroadband.com/1GB.zip"
str curl_exepath="F:\portableapps\_download\curl\bin\curl.exe"
str targetfolder="$Desktop$"
str filename_saved="testfile.zip"
targetfolder.expandpath
str controls = "4 5"
str e4 re5
e4=F"{curl_exepath} ''{url}'' --output ''{targetfolder}\{filename_saved}''" ;; %CURL_EXE_PATH% "%URL%" --output "%FULLPATH_TO_FILE%"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret
#sub DlgProc
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,,ExeOutputControl id(5 hDlg)
,,str cl output
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case 3
,,cl.getwintext(id(4 hDlg))
,,;; _i=RunConsole2(cl 0 0 1) ;; tried '1' flag, shows window but does not show realtime output
,,_i=RunConsole2(cl) ;; out is now redirected to 'ExeOutputControl'
ret 1