12-09-2013, 04:54 PM
Hi there!
In the archive files there is a progress bar dialog that works with a timer. The code is this:
Function progress_bar
I want to know if I could use this progress bar to see the actual progress of something like copying a file.
Let's say I have something like this:
Function test
And have the progress bar Dialog give me the progress on that code. Can I do that?
Thanks!!
In the archive files there is a progress bar dialog that works with a timer. The code is this:
Function progress_bar
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
if(!ShowDialog("barra_progresso" &barra_progresso 0 0 0 0 0 0 0 0 "\\nsn-intra.net\EEFS\GS\sn ss gnoc\projects\tim\Menu TIM\miscellaneous\icons\timmenu-2.ico")) ret
;BEGIN DIALOG
;0 "" 0x10C80A48 0x100 0 0 198 27 "Update do MenuTIM"
;3 msctls_progress32 0x54000000 0x4 8 10 136 12 ""
;5 Static 0x54000000 0x0 150 10 44 12 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2010900 "" ""
ret
;messages
;you can change these values
int range=300
int step=1
int timerperiod=1 ;;should be >=50
int- ti
int hpb=id(3 hDlg)
str s
sel message
,case WM_INITDIALOG
,SendMessage hpb PBM_SETRANGE ti range<<16
,SetTimer hDlg 1 timerperiod 0
,case WM_TIMER
,ti+step
,SendMessage hpb PBM_SETPOS ti 0
,if(ti<range) s.format("%i %%" 100*ti/range)
,else
,,s="Completed"
,,KillTimer hDlg 1
,, DT_Ok hDlg ;;close dialog
,s.setwintext(id(5 hDlg))
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
I want to know if I could use this progress bar to see the actual progress of something like copying a file.
Let's say I have something like this:
Function test
OnScreenDisplay "Copying file 1"
cop "c:\test\test.xls" "c:\test2\test.xls"
OnScreenDisplay "File 1 - Done!"; wait 1
OnScreenDisplay "Copying file 2"
cop "c:\test\test2.xls" "c:\test2\test2.xls"
OnScreenDisplay "File 2 - Done!"; wait 1
And have the progress bar Dialog give me the progress on that code. Can I do that?
Thanks!!