Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
image resource in dialog without extracting to tmp location?
#1
Is it possible to add an image resource without extracting it to an (temporary) location?
Below I have a dialog and I want to show an image that is "embedded" within the .exe

If possible I want "run" the image when the button "SHOW IMAGE" is clicked.
It is then opened in the default set application within the users OS.
All this without extracting it to an temporary location.

Function show_image
Code:
Copy      Help
;\Dialog_Editor

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 Button 0x54032000 0x0 63 50 100 35 "SHOW IMAGE"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040202 "*" "" "" ""

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
ret 1

I read the chapter "Resources (macro resources)" , 'LoadPictureFile' seems to be the way to go (?)
As always... I can't get the syntaxt right (if it is even possible to do this).


EDIT:
Forgot to mention I also want to use this method for creating shortcuts through my dialog.exe
The normal method adding of resources and then referring them through ":100" does not work.
(In other words, I can't get it working)

Function Function2
Code:
Copy      Help
SHORTCUTINFO si
si.target=exe_pth
si.iconfile=":100" ;; DOES NOT WORK
#2
Quote:It is then opened in the default set application within the users OS.
Need temp file.
Try res: protocol, but it opens in Internet Explorer.

For shortcut try si.confile=exe_pth; si.iconindex=-100;
#3
AH! Thank you!


Forum Jump:


Users browsing this thread: 1 Guest(s)