c# - Windows Shell: How to associate different xml-files with different apps? -


i have many kinds of xml-files (all extension .xml) different root element name , namespace. want associate each type different application , make possible have different file-icons each type. can done using c# .net?

the way handle in similar way visual studio uses handle .sln files visual studio version selector. application 1 gets associated .sln files , handles providing icon , eventual process handle specific .sln file. assuming have visual studio installed, take in registry @ hkey_classes_root\visualstudio.launcher.sln see how it's done.

so need to:

  1. write executable can decide .xml files
  2. register process 1 responsible handling .xml files
  3. place logic in executable, or in configuration executable consumes, decides on per file basis.

for icons, take @ subkey shellex\iconhandler. you'll see points (on x64 machine visual studio 2010 installed) hkey_classes_root\wow6432node\clsid\{9a2b23e4-2a50-48db-b3c3-f5ea12947cb8} lists under inprocserver32 dll responsible providing icons files, in instance c:\program files (x86)\common files\microsoft shared\msenv\vsfilehandler.dll. you'll need implement similar dll shares configuration/logic of launcher process determine icon show on per file basis.

the usual caveat: writing shell extensions in managed code has been big "no no" because shell extensions loaded process shows common file dialogs. can cause merry chaos as, until .net 4.0, 1 version of clr can loaded process, have sure before doing this. given .net 4.0 supports in-process side side, may not issue you.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -