Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
time , and run dialog info help
#1
Sorry wrong post section
What i would like to do is while i have a dialog on my mac i want to make other things run from that dialog plz, while im here i would like to ask a couple questions if you dont mind

--------------------------------------------------------------------------------------------------------------------------------------
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

BEGIN DIALOG
0 "" 0x90C80A44 0x100 0 0 291 166 "Dialog"
1 Button 0x54030001 0x4 120 116 48 14 "OK"
2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
3 Button 0x54032000 0x0 0 0 48 14 "Button"
END DIALOG
DIALOG EDITOR: "" 0x2030008 "" "" ""

ret
messages
sel message
case WM_INITDIALOG
case WM_DESTROY
case WM_COMMAND goto messages2
ret
messages2
sel wParam
case IDOK
case IDCANCEL
ret 1
---------------------------------------------------------------------------------------------------------------------------

How would i get that to were i click button it will make a macro start and , how to get it show a time of the maco running when that button is also click ? please any help would be much apreciated, i love qm and im learning alot about it , its just amazing thanks, alot for the program
#2
Function Dialog2
Code:
Copy      Help
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
if(!ShowDialog("Dialog2" &Dialog2)) ret
;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 151 98 "Dialog"
;1 Button 0x54030001 0x4 2 38 48 14 "OK"
;2 Button 0x54030000 0x4 56 38 48 14 "Cancel"
;3 Button 0x54032000 0x0 2 12 48 14 "start"
;END DIALOG
;DIALOG EDITOR: "" 0x2030008 "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
,mac "Macro"
,out _s.time("%X")
,case IDOK
,case IDCANCEL
ret 1
#3
Well what that code does is when i clickt he button it puts the time in the bottum of the macro well
what im trying for it to do is, record a time in the dialog show an extra window in the dialog that records hours min and sec if you dont mind
and if you could figure that out so when i have the dialog opened , what i want it to do is
when i click the button/ i want it to run a function that i have made and that function will run non stop but what i want in the dialog is an extra window that records the time the macros has been running
also i want another button that when you click stop the dialog stop button stops it all and the timer from timing Wink ty please help if posible thanks alot.
#4
Function dlg_run_function_with_timer
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

if(!ShowDialog("dlg_run_function_with_timer" &dlg_run_function_with_timer 0)) ret

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;3 Button 0x54032000 0x0 6 32 48 14 "Start"
;4 Button 0x54032000 0x0 58 32 48 14 "Stop"
;5 Static 0x54000000 0x0 6 54 100 24 ""
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030009 "*" "" ""

ret
;messages
int-- t0
sel message
,case WM_INITDIALOG
,case WM_DESTROY goto g2
,case WM_COMMAND goto messages2
,case WM_TIMER
,int s(GetTickCount-t0/1000) m h
,m=s/60; s%60
,h=m/60; m%60
,;g1
,_s.format("%02i:%02i:%02i" h m s); _s.setwintext(id(5 hDlg))
ret
;messages2
sel wParam
,case 3 ;;Start
,str-- func
,func="Function53" ;;change this
,mac func; err ret
,t0=GetTickCount
,SetTimer hDlg 1 100 0
,goto g1
,
,case 4 ;;Stop
,;g2
,KillTimer hDlg 1
,shutdown -6 0 func; err
,ret
,
,case IDOK
,case IDCANCEL
ret 1
#5
ok that works good it starts at 12:00 i was wanting it to start the timer at 0:00 but this will workWink thanks and instead of typing in the function to run i wanted it to run a sertian function when i click the button
#6
In your locale 0 hours is displayed as 12 hours. I used locale where 0 is 0. Also the timer would go to 0 or 12 hours after 1 day. I changed the code.
#7
Thanks soo much its running perfect Smile


Forum Jump:


Users browsing this thread: 1 Guest(s)