Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Attach a Run to a Dialogue Button
#2
open qm dialog editor
 on the dialog editor window select the control(button in this case) you want to execute code from
then click the events buttons.(the lightning icon)
   

it will open another window
   

select BN_CLICKED
click ok on that window
it will insert code for that event into the dialog procedure
Then just need to add run code

example with run program and open file two buttons
Function DialogRunOrOpenFile
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
;3 Button 0x54032000 0x0 33 48 48 14 "Run" "click to run or open file"
;4 Button 0x54032000 0x0 144 48 48 14 "Open"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040C00 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case 3 ;;Run
,run "$windows$\notepad.exe";; run notepad
,case 4 ;;Open
,run "$qm$\License.txt"
ret 1


Messages In This Thread
Attach a Run to a Dialogue Button - by flycaster - 04-17-2021, 10:04 AM
RE: Attach a Run to a Dialogue Button - by Kevin - 04-18-2021, 03:31 AM
RE: Attach a Run to a Dialogue Button - by Kevin - 04-23-2021, 03:42 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)