Page 1 of 1

"Virtual icons" possible in any way?

Posted: 24 Nov 2022 20:23
by eil
After popup-menus scripting was added i was using some simple menus with icons, basically using bold format:

Code: Select all

C:\Program\Launch.exe|C:\Program\Launch.exe|C:\Program\Launch.exe
name|location|icon
As i understand i was using everything right and only way possible when adding icons to menus.

But then one day i suddenly realised, that each time when i open say a menu of 20 items with icons = it's 20 reads from different parts of hard drive, and i didn't even do anything useful yet, or maybe even i won't select anything. Plus when such menus opened dozens times per day, and again just to open some one item from there while other files are still read each time = it results in hundreds, if not thousands, of useless I/O operations.
As a result i remade menus no have no icons, but that surely is less practical. Then i remembered how i adapted some scripts to load-store their data in variable on first run per session and next times these scripts are run there was no unnecessary reads just for menu forming.
So i wonder, if there is some way via XY to send icons into ram/variables? Or maybe there is a way to transform icons into base64 and use that stored in ram/variable, instead of real reading files?

Re: "Virtual icons" possible in any way?

Posted: 24 Nov 2022 20:45
by highend
Create a .dll from all the icons necessary and load them via their id?

Re: "Virtual icons" possible in any way?

Posted: 24 Nov 2022 22:06
by eil
That will solve only moment with reading from different places, dll would still be read each time. Plus constantly updating these dlls with new icons corresponding to new items in menus would be not convenient.

Re: "Virtual icons" possible in any way?

Posted: 24 Nov 2022 22:09
by highend
Nope, Windows does file caching. It's not constantly reread.

If Don has time to implement base64 encoded icon decoding into all the necessary places... I doubt that^^

Re: "Virtual icons" possible in any way?

Posted: 24 Nov 2022 23:45
by GreetingsFromPoland
if that option gets added, this is a nice to use for quick encoding of files to base64 (https://jpillora.com/base64-encoder/). i use this on my php site that creates an offline file that displayes font awesome icons when no connection is available.

Re: "Virtual icons" possible in any way?

Posted: 25 Nov 2022 00:36
by eil
highend wrote: 24 Nov 2022 22:09 If Don has time to implement base64 encoded icon decoding into all the necessary places... I doubt that^^
Actually i was exactly planning to ask for that if no similar already present way would be found. :roll:
Though thank you for mentioning about caching dlls, need get more info how that works.

Re: "Virtual icons" possible in any way?

Posted: 25 Nov 2022 06:57
by highend
There is no need for an external website, XY can encode base64 via scripting already