Icons Appear When Insert Disk
Originally posted by Jmitch@May 19 2003, 12:55 PMYa sorry, must have missed that one smoke. Did they come out with a new version???
They must have because the last time I tried it, it didn't work for me either and now it does.
two files, the .exe and a .ini file
the .ini contains 1 line CLSID={E0E39FB2-6C87-4EDB-89CB-45620277AAEB}
this GUID is the shell folder that you want to dis/appear when a CD is inserted.
See this link for how to create a drive icon on your desktop using a unique GUID
To generate a unique GUID use thePowderRangers GUID generator (My mirror was corrrupted, will put it back up soon)
The desktop refresh code isn't working effectively so it make take some time before the icon disappears after removal, you can right click the desktop and select refresh to make it dissapear sooner.
Should you need to kill the process it should be in the task manager under PCCaptionButtons.
hey connor
Thanks a lot ! I think we've been waiting for that thing to happen long time now!:rule:
EDIT: thank you too thepowerranger! :bow:
Ummm....super confused on how to do it. :blush:
Maybe if you could give a tutorial for Stinky N00bs like me, we would be able to express our gratitude better.
I realize all the info is there, but A step by step guide would be appreciated.
So are we letting him into our coke parties now? :coke-party:
ehm... ![]()
you can try this:
1. Create a text .reg file and paste into the registry code below, save, to create a registry addition file.
Note that the GUID number must be free on your machine. If you aren't sure, dwl my GUIDGen to creates new one and it uses that one generated in place of that one in the code (all keys). Then replace the drive letter with you CD drive letter (ex. D:\).
Double click it and confirm all requests.
So refresh your desktop and a new icon of c: drive appears.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954D}]
@="Drive C"
"InfoTip"="Drive C"
"{305ca226-d286-468e-b848-2b2e8e697b74} 2"=dword:ffffffff
[HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954D}\DefaultIcon]
@="%SystemRoot%\System32\shell32.dll,8"
[HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954D}\InProcServer32]
@="shdocvw.dll"
"ThreadingModel"="Apartment"
[HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954D}\Instance]
"CLSID"="{0afaced1-e828-11d1-9187-b532f1e9575d}"
[HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954D}\Instance\InitPropertyBag]
"Attributes"=hex:15,00,00,00
"Target"="C:\"
[HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954D}\ShellFolder]
"Attributes"=hex:50,00,00,F0
"WantsFORPARSING"=""
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{645FF040-5081-101B-9F08-00AA002F954D}]
@="Drive C"
2. Download PCDMonitor from the Connor's post above and paste you generated GUID into the .ini file.
3. Execute the PCDMonitor.exe file (the program haven't any interface, so you'll can find it in the processes).
Thats all: if all it's right, every time that you will insert a cd in the reader, the icon will appear on the desktop after you refresh it (with F5 or with right click->refresh).
I have not had the time to try it, good luck!! ![]()
...and contrasutra, sorry for my english ![]()
To refresh the desktop, try this
HWND hDesktop;
hDesktop = FindWindowEx(NULL, NULL, "FolderView", "SysListView32"); //retrieve desktop's hWnd
::RedrawWindow(hDesktop, NULL, NULL, NULL); //redraw it
it should refresh the desktop ![]()
Ups... does it works for you?
I have a folder icon on my deskop called "Drive E", if I insert a CD disk into my drive and press F5 (refresh desktop) nothing was happend.
:woot:
feat: take the CD out, hit F5 and the Drive E should disappear. Put the CD in again it should come back.
Siwu:Thanx, I'll try that.
I'm currently using:
SHGetSpecialFolderLocationD(Me.hwnd, CSIDL_DESKTOP, lpil);
SHChangeNotify(SHCNE_ALLEVENTS, SHCNF_IDLIST, lpil, 0);
without success, which is the "Explorer" method however the "windows" method should be better.
conner, here's the link i blev u may b lookin for (Y) --> http://www.codeguru.com/misc/IconOutliner.html
the app he's created works like a dream. and although im no great programmer the Tut seems to make scense. i dont think its the same language your usin, but im sure u can adapt it.
as for your app, sounds great, but it dosnt seem to work for me. <_< not sure which registry keys your tweaking, but ive noticed the extremely crude version i put together required me to edit the values in all these
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel]
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu]
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel]
hopefully this will help. if it dosnt and you dont mind, i could take a look at your code, but thats up to you.
however im sure u will fix the problem :smartass:
-The Unknown
TheUnknown: Thanks for the link, I'll take a look.
As for your registry issue, you are right and I will switch it to do it that way.
In general you only need to change two keys, either:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel]
or
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu]
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel]
There is another reg key which basically says "Make Hiding Desktop icons a Per User Setting" Tweak XP switches this on.
so you don't need to worry about setting all 4 keys.
I can renable per machine disabling in the software and send another copy up to the server tonight.
Yes the link helped, although I did a search for simmilar example code in VB rather than in C++, I'm looking at integrating it just now. It may be tomorrow before I can post a copy on my Web server.
As for the refresh code, VB doesnt like the refreshwindow line properly.
I decided to use:
Dim hwnd As Long
Dim j As Long
Dim i As Long
hwnd = FindWindow("Progman", "Program Manager")
j = GetWindow(hwnd, GW_CHILD)
i = PostMessage(j, WM_KEYDOWN, &H74, 3)
Which literarly sends an F5 press to the desktop Window.
sounds great, its your app so code it how u feel is best.
question: sumtime in the future, would u b able to implement support for mulitple CD drives and even removable devices (USB Sticks). i would rather not launch the app 3 times.
also dont rush it, take your time. a few extra days means nuffin.
-The Unknown
ok, i sorta have this worked out, but just to see how compatible it is with everyone elses system...
giv it a go. Drive Mount
-The Unknown
Good Stuff, I'll give it a try.
My development has stopped outright, as things have got hectic at work (Still getting some time to do the Itunes Skin for WMP - V3)
I assume from your Readme, that it simply checks each drive with a dir statement and if it returns a listing then show the icon for that drive?
It might also be possible to grab the Autorun.inf off the drive and update
[HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954D}\DefaultIcon]
@="%SystemRoot%\System32\shell32.dll,8"
with the icon specified by that file.
Hope your development proceeds well.
Originally posted by theunknown@Jun 10 2003, 01:01 PMok, i sorta have this worked out, but just to see how compatible it is with everyone elses system...
giv it a go. Drive Mount
-The Unknown
oh yes: it works !! 
But I think that I will not use it, why on my system currently runs DesktopX and when the drive icon appears, the IconX technology doesn't update the icon image. Moreover, I have noticed that when I don't use DesktopX, the icon does appear always in the upper-left corner.
However, great work !!! :bow:
im sorta working on the icon allignment.
an since i dont use DesktopX or IconX, i cant accomodate them. thanx for the reply though.
-The Unknown
Originally posted by theunknown@Jun 11 2003, 02:44 PMim sorta working on the icon allignment.
an since i dont use DesktopX or IconX, i cant accomodate them. thanx for the reply though.
-The Unknown
thanks to you my friend !! :bow:
...don't worry for my problem with DesktopX, I try to fix it myself in my little free time ![]()
bye
@theunkown: is it possible to tell XP the exact location of an icon in the desktop? If so, it would be awesome to implement that. Just wondering... :ninja:
Ender: The link The Unknown Posted above ";http://www.codeguru.com/misc/IconOutliner.html"
explains how to read the positions of all desktop icons
and then set them back at a later date.
So they can be fixed on the screen.
Aqua-Soft Forums