Posts: 795
Threads: 136
Joined: Feb 2009
Hello, it's me again :roll:
I have a macro i can compile.
I contains a systray icon.
Tray f.AddIcon("c:\mypathtoicon\1.ico[]c:\mypathtoicon\2.ico" "Initialisation")
I'd like :
1) to see the icon when exe is running. It works fine from QM, i added it from compilation option, but the systray icon is empty.
2) how to interact with icon (i.e have a dialog on right click)?
Thanks.
Posts: 12,097
Threads: 142
Joined: Dec 2002
Macro
Macro1090
;/exe
if(!dir("$pf$\quick macros 2\copy.ico")) mes- "could not find $pf$\quick macros 2\copy.ico"
Tray f.AddIcon("$pf$\quick macros 2\copy.ico[]$pf$\quick macros 2\paste.ico" "Initialisation" 0 0 0 0 "Dialog70")
mes 1
Posts: 795
Threads: 136
Joined: Feb 2009
Hi,
for the icon it works, but i was thinking about a way to integrate them in the exe and then called them at run time, so it is OS and computer independent.
I've been struggling with
Adding files to exe resources and extracting at run time for 2 days now, but it seems far beyond my skills.....
Will the /exe line make it portable, i.e integrated at compilation time in exe?
Thanks.
kind regards,
Laurent.
Posts: 12,097
Threads: 142
Joined: Dec 2002
Posts: 12,097
Threads: 142
Joined: Dec 2002
Macro
Macro1091
;/exe
Tray f.AddIcon(":200 $pf$\quick macros 2\copy.ico" "Initialisation" 0 0 0 0 "Dialog70")
;Tray f.AddIcon(":200 $pf$\quick macros 2\copy.ico[]:201 $pf$\quick macros 2\paste.ico" "Initialisation" 0 0 0 0 "Dialog70") ;;does not work with multiple icons
mes 1
In Make Exe dialog check 'auto add image files'. Add a resource id in file paths, like in the example. Currently QM does not support multiline strings with resource id.
Posts: 12,097
Threads: 142
Joined: Dec 2002
The exe line just tells QM to run the macro in separate process. QM converts the macro to exe.
Posts: 795
Threads: 136
Joined: Feb 2009
Hi,
sorry but i don't understand...
What i want is to choose an icon at coding time, and make it available for the exe i compile later, to show it in the tray, even on a computer that does not have it inatalled.
is it clearer now?
Thanks.
Posts: 12,097
Threads: 142
Joined: Dec 2002
In Make Exe dialog check 'auto add files...'. In macro, use icon path like
Macro
Macro1091
Tray f.AddIcon(":200 $pf$\quick macros 2\copy.ico" "Initialisation" 0 0 0 0 "Dialog70")
Then QM adds the file to the exe. The file does not have to exist on all computers.
Posts: 795
Threads: 136
Joined: Feb 2009
Great, seems to work.
in fact, sometimes, i'm lost in help between windows API and QM own implementation of some classes.
Can I use the same technique to store objects in exe and use them at run time to use them (bitmaps, icons, richedit text, files etc)?
kind regards,
Laurent.
Posts: 12,097
Threads: 142
Joined: Dec 2002
Yes, most functions that load images and other files support ":resourceid filepath" syntax. QM functions, not Windows API. Look in QM help, Make Exe topic, Resources.
Posts: 795
Threads: 136
Joined: Feb 2009
Great.
I'll try. I must now tweak the application with right click management and windows events stuff.
Stay tuned for another thread
Thanks