开发者

Changing Icon of IE Toolbar Button

I have a standard IE toolobar button component with IOleCommandTarget interface. Icon of the button is set in开发者_JAVA百科 windows registry. Is posibble to dynamically change the icon while IE is running?


You can't do that, at a minimum, until the user clicks on it. Before that time, registry-loaded toolbar buttons do not load any code, and hence there's no way to call any API to change the button's image.


What Eric says is true, but you could have a BHO component that gets instantiated much eariler. Then you could try to find the HWND of the toolbar and send the appropriate window messages to change your buttons icon, but the processes and integrity level separation in IE8 and IE9 make that almost impossible these days. So at this point, yeah you're out of luck. Changing the icon isn't a scenario that was ever deemed important.


I don't think you can do that. I had a similar situation. I was able to update the registry with the new icon, but it displayed only after I restarted my IE browser.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜