Icon change for a built-in TB button?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Icon change for a built-in TB button?

Post by aurumdigitus »

For some obscure reasons would like to change the icon for a built-in TB button. But since the Context menu exhibits no Edit function it seems impossible.

But that said, do you of the XY cognoscenti know of a path by which this can be accomplished?

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Icon change for a built-in TB button?

Post by TheQwerty »

You could use a resource "hacker" to attempt to replace the icon stored in XYplorer.exe, but I definitely do NOT recommend this.

You could replace the built-in button with your own custom version. I just posted an example of this for another user.

You could do one better than that example and just call the original button's actions using the Button() SC, but it's difficult to get a true replacement if the button has a dropdown arrow and it's not extremely clear how to immediately show the context menu. The latter can be done by making the right-click script something like:

Code: Select all

"_Initialize" Button('visualfilter', 2);
However in doing this you make it difficult to then edit that button - though there exists another script for that. You might be able to handle the former by jumping through some hoops and using Get('Trigger'), but I haven't experimented with this.



If you don't mind my asking which button are you trying to change?

Nighted
Posts: 463
Joined: 21 Jan 2007 01:58
Location: Gitmo Nation North, Win 7/10/Linux/(x64)

Re: Icon change for a built-in TB button?

Post by Nighted »

XY uses a PNG to store its icons. This is difficult to replace with resource hacker alone.
I want XY to serve soft ice cream. Please Don, make XY serve soft ice cream.

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: Icon change for a built-in TB button?

Post by aurumdigitus »

TheQwerty wrote:If you don't mind my asking which button are you trying to change?
It is a circuitous little tale. Very much liked the Expandable drive button script by serendipity. Only later came to realize it did not display the two optical drives on the machine. Pondering the situation remembered reading Don's suggestion some place to just use the Computer button. That does the job but wanted the icon to show main purpose of drives per se not the computer.

So using you code suggestion modified to:
"_Initialize" Button('myco', 2);
in a CTB with :drives for the icon all is well.

Thank you for again solving the problem. :appl:

Post Reply