Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Controlling macro from open dialog
#13
Hi Gintaras, I made some changes to the dialog (removed an edit box) and somehow I broke SendMessage command. It was working Sad

The function no longer sends anything back to the dialog- not sure what I have done, looks like it should be working, would you mind taking a look?

Function Hot_Dialog
Code:
Copy      Help
/Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages


;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 287 130 "The Roulette Project"
;3 Button 0x54032000 0x0 6 4 48 14 "Start"
;4 Button 0x54032000 0x0 6 22 48 14 "Stop"
;9 Edit 0x54200844 0x20000 60 4 226 125 ""
;2 Button 0x54030000 0x4 6 42 48 14 "Exit"
;END DIALOG
;DIALOG EDITOR: "" 0x2030408 "" "" "" ""

str controls = "9"
str e9
if(!ShowDialog("Hot_Dialog" &Hot_Dialog &controls)) ret
ret
;messages
sel message
,case WM_INITDIALOG
,/SetDlgItemText hDlg 6 ""
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_APP
,int c=id(9 hDlg)
,SendMessage c EM_SETSEL 1000000000 1000000000
,SendMessage c EM_REPLACESEL 0 F"{lParam%%s}[]"


ret
;messages2
sel wParam
,case 3
,SetDlgItemText hDlg 3 "Running"
,EnableWindow id(3 hDlg) 0; EnableWindow id(4 hDlg) 1
,mac "Hot";; " " hDlg _s.getwintext(id(6 hDlg))

,
,case 4
,SetDlgItemText hDlg 3 "Start"
,shutdown -6 0 "Hot"
,EnableWindow id(3 hDlg) 1; EnableWindow id(4 hDlg) 0
,
,case IDCANCEL
ret 1

Function Hot
Code:
Copy      Help
/out(F"Keep window open is now {KeepWindowOpen}")
,out_spinnumber.from(F"Spin number is {TotalSpins}")
,out_spinnumber.setfile("$my qm$\QmData\nums.txt" -1 -1 1)
,SendMessage hDlg WM_APP 1 out_spinnumber
,/out out_spinnumber

Thanks so much
Matt


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)