Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pictures in EXE dialog
#1
I want to put some buttons with pictures in a exe dialog file. Is it correct that the only way to do this is with a DLL and if so how do I make a DLL file?
#2
http://www.quickmacros.com/help/index.ph...KEEXE.html
Resources
Resources are files and other data added to exe file. Can contain bitmaps, icons, cursors, dialogs, menus, accelerators, strings, version info, binary data (e.g. files), etc. If you use external files in macros/functions that are added to exe, you should either distribute them together with the exe or add them to exe as resources. For example, if you use scan, you can add bitmap files to resources so that you would not have to distribute them together with the exe file as separate files.



If "Auto add image files" is checked, QM automatically adds image files to exe. QM searches the source code of all macros/functions that are added to exe (except as text) for strings in form ":resourceid file.ico" or ":resourceid file.bmp", and adds these files as resources. Resource id (resourceid) must be a number between 1 and 0x7fff. Icon resource id should be > 133. This syntax (":resourceid file") is supported by scan, ShowDialog, GetFileIcon, LoadPictureFile. For example, to automatically add bitmap file used with scan, use code like scan ":10 file.bmp", and check "Auto add image files".



QM 2.2.0. Any files can be added to exe using #exe addfile. They are added as resources of type RT_RCDATA.



To add more resources, you need a resource editor. QM does not have its own resource editor, so you would have to find and download one. Using the resource editor, add all that you need and save to a file with res extension. Specify the file in the Make Exe dialog. When creating exe, QM will add resources from the file to the exe.



Whenever you edit image files or res file, you should make exe again, otherwise resources will not be updated in exe.



QM functions that support resources: ShowDialog (title bar icon, icons, bitmaps, menu, accelerators), DT_CreateMenu (menu, accelerators), scan (bitmap, icon), GetFileIcon (icon), LoadPictureFile (bitmap). With these functions, a resource can be specified as string in format ":resourceid" (e.g. ":300").
#3
Dialog: Bitmap or Icon on Button

I had posted this and it is the only EXE that I have found that will show picture buttons in a exe dialog. This bring me back to my question. I have reread your post but it does not answer my question. If you have a way of puttting a picture button in a EXE dialog without a DLL then please give me an example otherwise can you please tell me how to make a DLL


I am not trying to be smart but I have spent months on this and can not seem to get it.


Thank You
Kenneth
#4
In Make Exe dialog check Auto add image...
In macro, before image paths insert :id , where id is some number. The number must be different for each image file.

Code:
Copy      Help
;/exe
\Dialog_Editor

function# hDlg message wParam lParam
if(hDlg) goto messages

if(!ShowDialog("Dialog49" &Dialog49)) ret

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;3 Button 0x54032000 0x0 6 4 212 16 "Bitmap with text"
;4 Button 0x54032000 0x0 6 24 212 16 "Icon with text"
;5 Button 0x54032080 0x0 6 50 212 16 "Bitmap without text"
;6 Button 0x54032040 0x0 6 70 212 16 "Icon without text"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2020105 "" "" ""


ret
;messages
sel message
,case WM_INITDIALOG
,;SetWindowTheme id(3 hDlg) L"" L""
,;SetWindowTheme id(4 hDlg) L"" L""
,SendMessage(id(3 hDlg) BM_SETIMAGE IMAGE_BITMAP LoadPictureFile(":200 $my qm$\macro527.bmp" 0)) ;;can be bmp, gif of jpg
,SendMessage(id(4 hDlg) BM_SETIMAGE IMAGE_ICON GetIcon(":300 $qm$\mouse.ico"))
,SendMessage(id(5 hDlg) BM_SETIMAGE IMAGE_BITMAP LoadPictureFile(":200 $my qm$\macro527.bmp" 0)) ;;can be bmp, gif of jpg
,SendMessage(id(6 hDlg) BM_SETIMAGE IMAGE_ICON GetIcon(":300 $qm$\mouse.ico"))
,case WM_DESTROY
,DeleteObject(SendMessage(id(3 hDlg) BM_GETIMAGE IMAGE_BITMAP 0))
,DestroyIcon(SendMessage(id(4 hDlg) BM_GETIMAGE IMAGE_ICON 0))
,DeleteObject(SendMessage(id(5 hDlg) BM_GETIMAGE IMAGE_BITMAP 0))
,DestroyIcon(SendMessage(id(6 hDlg) BM_GETIMAGE IMAGE_ICON 0))
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1


;BEGIN PROJECT
;main_function  Dialog49
;exe_file  $my qm$\Dialog49.exe
;icon  $qm$\macro.ico
;manifest  $qm$\default.exe.manifest
;res  
;on_before  
;on_after  
;on_run  
;flags  22
;end_hotkey  0
;guid  {844D3E4A-D891-43F3-8C8B-DBA876E1073A}
;END PROJECT

Note that buttons can have image and text only on Vista. On XP they can have only text or only image.
#5
Thank You Gintaras; I have try-ed this and can get most to work I am sure that I will get the rest to work as I learn.



AGAIN

Thank You
Kenneth
#6
OK got all XP to work. Thank You
#7
One question. About this (SetWindowTheme id(5 hDlg) L"" L"") Should I use it here? I can see no difference if I use it or do not use it.

Code:
Copy      Help
,;SetWindowTheme id(5 hDlg) L"" L""
,SendMessage(id(5 hDlg) BM_SETIMAGE IMAGE_BITMAP LoadPictureFile(":200 $my qm$\1-1.bmp" 0)) ;;can be bmp, gif of jpg
#8
No difference. Or try to enable and see what happens.


Forum Jump:


Users browsing this thread: 1 Guest(s)