在WINDOWS中,怎么在“我的电脑”或是桌面加入自己的图标?用COM做SHELL组件可以实现,这个我知道,但具体有没有这样的实例?因为我不要求有多复杂,只要求这个图标能响应右键,和双击就行了。以前看到过这样的源码,当时也没在意,现在忽然要找,怎么也找不到了。所以请各位帮帮忙,知道原理的说个方法。有源码的也请不要吝惜,请赐源码,我将感激不尽!邮箱:[email protected]
我发的贴子一向都是在5天之内结贴,而且按质量的高低给分,如果真能有对我有帮助的回复,再开一贴另外给分。

解决方案 »

  1.   

    http://topic.csdn.net/t/20030626/12/1959932.html
      

  2.   

    不是快捷方式,是用COM创建的类似于虚拟目录的东西。
      

  3.   

    http://74.119.233.100/temp.jpg
    就是在这些位置加入一个项目,这绝对不是快捷方式。是一些SHELL组件对应的应该有一个COM的DLL文件
      

  4.   

    上个看不到图再发一个就是在这些位置加入一个项目,这绝对不是快捷方式。是一些SHELL组件对应的应该有一个COM的DLL文件
      

  5.   


    就是图中“其它”组是两个项目,这样不知道我说明白了没有,不是快捷方式。用MSDN的说法这东西好像是叫Namespace,但那上面的我怎么也没有看明白,实在不知道要怎么实现这样的功能。所以,请大家指教一下,有什么办法可以实现??
      

  6.   

    Step 1: Create a Unique Key--------------------------------------------------------------------------------Open registry with “regedit” command on run window.
    Navigate to HKEY_CLASSES_ROOT\CLSID\. Then right click and create a new key with value as {FD4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}
    Now set the default value of this key to the folder name you want to use. Now your path will look like ( I will call this as parent key throughout the discussion) HKEY_CLASSES_ROOT\CLSID\{FD4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}
    Step 2: Add Custom Icon to the folder--------------------------------------------------------------------------------Now create a sub key under parent key.
    Name it as “DefaultIcon”.
    Set the default value of this to the path of the icon image you want to use.
    If you dont specify your icon, system will take default icon.Step 3: Adding attributes--------------------------------------------------------------------------------Under parent key create another key with name as “InprocServer32″
    Set the default value as “shell32.dll”
    Again at the same level create another folder as “ThreadingModel” and set its value as “Apartment”
    Same way create another key (under parent level) at the same level with structure as \Shell\My Folder\Command
    Set the default value here as “explorer /root,c:\Blog Data”
    This has to be same which you gave when you created the first key.Step 4 Adding Handlers--------------------------------------------------------------------------------Under parent key, create another key as \ShellEx\PropertySheetHandlers\ {FD4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}
    Similar way another key is to added to parent key as “Shell Folder”
    In this right click and create new binary value called as “Attributes” with value as 00 00 00 00.Step 5: Settings to place in My Computer--------------------------------------------------------------------------------Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
    Then to \CurrentVersion\Explorer\MyComputer\NameSpace\
    Add the parent key which in this case is {FD4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}
      

  7.   

    http://www.codeproject.com/info/search.aspx?artkw=IShellFolder&sa_ao=False&sa_so=17&sa_as=1%2c3%2c4%2c5%2c6&pgnum=1
    看下是不是你需要的,
    google下IShellFolder.