Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot get it to work
#1
i cannot get this to work can u check it out?

\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 217 47 "Fire Giant Timer"
1 Button 0x54030001 0x4 108 28 48 14 "OK"
2 Button 0x54030000 0x4 162 28 48 14 "Cancel"
3 msctls_progress32 0x54000000 0x4 8 10 136 12 ""
4 Button 0x54032000 0x4 8 28 48 14 "Start"
5 Static 0x54000000 0x0 160 10 48 12 ""
END DIALOG
DIALOG EDITOR: "" 0x2030208 "" "" ""

ret
messages
sel message
case WM_INITDIALOG DT_Init(hDlg lParam); ret 1
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

case 4 ;;Start
opt waitmsg 1
int i; str s
i=0
int hpb=id(3 hDlg)
for i 0 100
SendMessage hpb PBM_SETPOS i 0
s.format("%i %%" i); s.setwintext(id(5 hDlg))
3.0
if i=95
run "$desktop$\FG.wav"
lef
SendMessage hpb PBM_SETPOS 0 0
s="Completed"; s.setwintext(id(5 hDlg))

Default range is 100. To change, SendMessage hpb PBM_SETRANGE 0 max<<16|min
PBM_DELTAPOS can be used insted of PBM_SETPOS to set increment instead of absolute value.

ret 1

says unknow identifier, don't know what to do
#2
tip to get help with code it needs to be posted correctly
for more info read
http://www.quickmacros.com/forum/showthread.php?tid=786

Q. How to post QM code to the forum?
A. In QM, to copy all or selected text, use menu Edit -> Other Formats -> Copy for QM Forum. It copies correct and colored code to the clipboard. Then simply paste in the forum. Don't use the Code button.
#3
your missing ShowDialog statement
example...
if(!ShowDialog("Function2" &Function2)) ret

function2 is the name of dialog function change to whatever your dialog function name is

Function Function2
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 217 47 "Fire Giant Timer"
;1 Button 0x54030001 0x4 108 28 48 14 "OK"
;2 Button 0x54030000 0x4 162 28 48 14 "Cancel"
;3 msctls_progress32 0x54000000 0x4 8 10 136 12 ""
;4 Button 0x54032000 0x4 8 28 48 14 "Start"
;5 Static 0x54000000 0x0 160 10 48 12 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030605 "" "" "" ""
if(!ShowDialog("Function2" &Function2)) ret
ret
;messages
sel message
,case WM_INITDIALOG DT_Init(hDlg lParam); ret 1
,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
,case 4 ;;Start
,opt waitmsg 1
,int i; str s
,i=0
,int hpb=id(3 hDlg)
,for i 0 100
,,SendMessage hpb PBM_SETPOS i 0
,,s.format("%i %%" i); s.setwintext(id(5 hDlg))
,,3.0
,,if i=95
,,,run "$desktop$\FG.wav"
,,,lef
,,SendMessage hpb PBM_SETPOS 0 0
,,s="Completed"; s.setwintext(id(5 hDlg))

;Default range is 100. To change, SendMessage hpb PBM_SETRANGE 0 max<<16|min
;PBM_DELTAPOS can be used insted of PBM_SETPOS to set increment instead of absolute value.

ret 1
code above works but!!!! if user clicks ok or cancel dialog closes but function continues to run cause of the for loop your using


Forum Jump:


Users browsing this thread: 1 Guest(s)