Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
progress bar
#1
can some give an example of a progressbar in a dialog
#2
msctls_progress32 (progress bar)
#3
how can u start progress bar when window is loaded instead of the start button
would be helpful if it could be done with a timer
#4
Function dialog_with_progress2
Code:
Copy      Help
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

def PBM_SETRANGE (WM_USER+1)
def PBM_SETPOS (WM_USER+2)
def PBM_DELTAPOS (WM_USER+3)

;BEGIN DIALOG
;0 "" 0x10C80A44 0x100 0 0 198 27 "Form"
;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=100
int step=1
int timerperiod=100 ;;should be >=50

int- ti
int hpb=id(3 hDlg)
str s
sel message
,case WM_INITDIALOG
,DT_Init(hDlg lParam)
,SendMessage hpb PBM_SETRANGE ti range<<16
,SetTimer hDlg 1 timerperiod 0
,ret 1
,
,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 DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
int ctrlid=wParam&0xFFFF; message=wParam>>16
sel wParam
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
ret 1

Macro
Code:
Copy      Help
if(!ShowDialog("dialog_with_progress2" &dialog_with_progress2)) ret


Forum Jump:


Users browsing this thread: 1 Guest(s)