tags:

views:

25

answers:

2

Hi,

I have created a ContextMenu DLL (to dispaly icon overlay and other shell context menus) and register it in my system.

Acutally, since it is a context menu dll, I wish only explorer exe should load my dll. But in my case, applications like 'Thunderbird', 'Process Explorer', 'Visual studio', ... etc are all using my dll.

Is there any way to avoid other applications using my dll. I only want explorer exe to load my dll. Is there a way to check this in my dll ???

Thanks in Advance.

A: 

In DllMain you can test the name of exe file which loaded your dll with respoct of GetModuleFileName with NULL as the firts parameter. If a wrong exe try to load your dll the DllMain can return FALSE.

Oleg
A: 

Thanks I will try.

ashar