12-05-2017, 05:01 PM
I know the basics of displaying an image in a dialog, but Is it possible to make a button in the dialog or an outside macro change the path of the specified image so that the image will change?
Function dialog_image
Trigger F12
Function dialog_image
Trigger F12
;\Dialog_Editor
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 248 152 "Set Image"
;3 Static 0x5400000E 0x0 16 16 96 96 ""
;4 Static 0x5400000E 0x4 136 16 96 96 ""
;7 Button 0x54032000 0x0 12 128 48 14 "Set 1"
;8 Button 0x54032000 0x0 68 128 48 14 "Set2"
;9 Button 0x54032000 0x0 132 128 48 14 "Set 1"
;10 Button 0x54032000 0x0 188 128 48 14 "Set2"
;5 Button 0x54020007 0x0 8 4 114 117 ""
;6 Button 0x54020007 0x0 128 4 112 117 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2040500 "*" "" "" ""
str controls = "3 4"
str sb3 sb4
sb3 = "$desktop$\img\1.png"
sb4 = "$desktop$\img\2.png"
if(!ShowDialog(dd &sub.DlgProc &controls)) 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 7
,out "Change to img\2"
,case 8
,out "Change to img\1"
,case IDOK
,case IDCANCEL
ret 1