sfern
asked on
Urgent desktop.ini problem
Hi again,
I'm giving up all the points i've got let for this question (88 Point)...Sorry got no more points let, but i'm really desparate.
Here is my question.
I've created a desktop.ini file inside a folder and assigned an icon to it.
This is the code of the desktop.ini file:
[.ShellClassInfo]
IconFile=C:\WINDOWS\unlock ed.ico
IconIndex=0
As i want to be able to change the icon, i've written a small test program with the following code:
(Note: 1 Button click changes to 1 folder icon and the otherchanges to the other.
Here it is:
procedure TForm1.Button1Click(Sender : TObject);
var
hDesktop: HWND;
begin
memo1.Lines.SaveToFile('C: \Windows\D esktop\Pri vate\deskt op.ini');
{NOW REFRESH THE DESKTOP}
hDesktop := FindWindowEx(FindWindowEx( FindWindow ('Progman' , 'Program Manager'), 0,
'SHELLDLL_DefView', ''), 0, 'SysListView32', '');
PostMessage(hDesktop, WM_KEYDOWN, VK_F5, 0);
PostMessage(hDesktop, WM_KEYUP, VK_F5, 1 shl 31);
end;
The memo contains the desktop.ini code.
It would work fine if it would refresh properly but it doesn't. :-(
Can anyone help me please? ...
I downloaded a program called E-Icons which does a very good refresh using DOS, but i don't know what to do anymore.
Please Help Me :-(
I'm giving up all the points i've got let for this question (88 Point)...Sorry got no more points let, but i'm really desparate.
Here is my question.
I've created a desktop.ini file inside a folder and assigned an icon to it.
This is the code of the desktop.ini file:
[.ShellClassInfo]
IconFile=C:\WINDOWS\unlock
IconIndex=0
As i want to be able to change the icon, i've written a small test program with the following code:
(Note: 1 Button click changes to 1 folder icon and the otherchanges to the other.
Here it is:
procedure TForm1.Button1Click(Sender
var
hDesktop: HWND;
begin
memo1.Lines.SaveToFile('C:
{NOW REFRESH THE DESKTOP}
hDesktop := FindWindowEx(FindWindowEx(
'SHELLDLL_DefView', ''), 0, 'SysListView32', '');
PostMessage(hDesktop, WM_KEYDOWN, VK_F5, 0);
PostMessage(hDesktop, WM_KEYUP, VK_F5, 1 shl 31);
end;
The memo contains the desktop.ini code.
It would work fine if it would refresh properly but it doesn't. :-(
Can anyone help me please? ...
I downloaded a program called E-Icons which does a very good refresh using DOS, but i don't know what to do anymore.
Please Help Me :-(
ASKER
I've just tried it but it's not changing the Desktop folder icon although the desktop.ini file is pointing to it. :-(
What icon are you changing?
The desktop icon inside Explorer?
Is the directory "private" correct? Should it be removed?
The desktop icon inside Explorer?
Is the directory "private" correct? Should it be removed?
ASKER
It's not a special folder, i just want to be able to change the icon at will.
When you open the folder in explorer it is changed but does not change on the desktop, i just need a good refresh
Sfern
When you open the folder in explorer it is changed but does not change on the desktop, i just need a good refresh
Sfern
ASKER
I'm trying to change the icon of a folder which resides on the desktop.
Sfern
Sfern
ASKER
Everytime i create a new folder and assign an icon to it for the first time it works, then...when you modify the desktop.ini file to point to another icon and refresh it, it does not change. :-(
ASKER
Everytime i create a new folder and assign an icon to it for the first time it works, then...when you modify the desktop.ini file to point to another icon and refresh it, it does not change. :-(
ASKER
Any way to refresh everything ?
ASKER
Don't know what to try anymore :-(((((((((
ASKER
can anyonemgelp please?
Try sending the message WM_SETTINGCHANGE?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
hum .. I don't have the refresh code in my app
but icon changing works everytime
here's the link to the complete project source:
http://lee.nover.has.his.evilside.org/isapi/pas2html.dll/pas2html?File=/delphi/Projects/AnyIcon
but icon changing works everytime
here's the link to the complete project source:
http://lee.nover.has.his.evilside.org/isapi/pas2html.dll/pas2html?File=/delphi/Projects/AnyIcon
ASKER
First of all thanks all for your help.
Icon.exe & source is for delphi 6 so couldn't make it work on mine but thanks anyway.
Now, the example from bes67 works fine, so i'll go for this one.
Thanks again
Sfern :-)
Icon.exe & source is for delphi 6 so couldn't make it work on mine but thanks anyway.
Now, the example from bes67 works fine, so i'll go for this one.
Thanks again
Sfern :-)
shellexecute(
0,
nil,
pchar('rundll32.exe'),
pchar('user,repaintscreen'
nil,
sw_Hide);
instead.
Richard.