开发者

Refresh windows explorer in order toolbar to disappear

I created a windows explorer toolbar in C#. This toolbar is removed when uninstalling 开发者_Go百科my applicaiton but it's still shown after unregistering (cached in explorer.exe). explorer.exe needs a restart in order toolbar to dissapear. How can I fix this by C# code?


There is really no way to do this cleanly without asking the user to log off.

If there is programatic access to turn off your toolbar, you could inject some code into every explorer process that has your dll loaded and turn off the toolbar and then call CoFreeUnusedLibraries (Still somewhat hacky but you would not have to kill processes)


I'm not sure that explorer would cache the toolbar if it's been properly unloaded. I know little about these things, but are you sure you're not missing a deregistration call in your installer?


foreach(Process p in Process.GetProcesses()){

try{

if(p.MainModule.ModuleName.Contains("explorer") == true)p.Kill();

}
catch(Exception e){}

Process.Start("explorer.exe");

}

Give that a go.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜