简体   繁体   中英

Windows Explorer Overlay Icons - how to start?

I'm currently trying to implement Overlay Icons for the Windows Explorer with Visual C++. For that, I read the Information on Microsoft MSDN (saying I have to implement IShellIconOverlayIdentifier ) and also some other resources on the Internet.

My problem is, that I'm not able to get the program running. I think, it's no problem to implement the logic to choose the correct icons, when I'm able to simply display any icons.

First I tried to create a Windows Service, but it seems that I cannot implement the interface then. Now I changed to a DLL and there aren't any compiler errors anymore, but when I try to register, it says the module was loaded, but the entry-point DllRegisterServer was not found. The problem seems to be that I do not have a COM Server, but do I really need it?

I also found a guide on CodeProject.com , which also does not have any compiler errors, but just displays no icons without any errors.

So, can anybody please shortly summarize how to start implementing Overlay Icons with Visual Studio and C++ (Service/DLL/..., any compiler options to be set, what is the minimum of code I need to display simple icons)?

The "icons" you're referring to are icons shown in the Explorer process. That means you're a guest in another process, and you must behave according to their rules.

If you understand this, it's clear why your code won't work in a service. A service is not the Explorer process.

If you understand this, it's clear why you must provide DllRegisterServer() . Explorer calls it.

The C++ compiler doesn't know about the particular rules of Explorer.EXE. However, you can tell the compiler about IShellIconOverlayIdentifier by including the header file where it's defined. That will tell the compiler it's actually a COM interface.

You probably should start with simple COM examples before trying something as complex as providing icons to another process outside your control. You can't compile Explorer.EXE in debug mode, so you only see one half of any problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM