Solved

How do I reload the icons on the desktop ?

Posted on 1997-10-19
5
331 Views
Last Modified: 2010-04-04
I want to change the default Desktop directory, so that the
icons of an other directory are shown on the Desktop.

I know how to change the Desktop directory in the Registry. But after changing this, I still need to reload the desktop to show the icons of the new directory but HOW CAN I DO THIS ????

Please help...
0
Comment
Question by:dms@
5 Comments
 
LVL 2

Expert Comment

by:Waldek
ID: 1348233
Maybe this:
RedrawWindow(0,nil,0,RDW_ERASE or RDW_ALLCHILDREN or RDW_INVALIDATE);
but i think , this redraw desktop but information about change desktop directory is not loaded from registry
0
 

Author Comment

by:dms@
ID: 1348234
The thing Waldek suggested doesn't work, because it doesn't reload the icons, but just redraws them.
0
 

Expert Comment

by:kangadru
ID: 1348235
Try using SHChangeNotify.  It is documented in the ShlObj.pas file.  You have to notify the system that thepaths and shell Icons has changed.

Andy

0
 
LVL 3

Expert Comment

by:mirek071497
ID: 1348236
Hi
I see so this is the second question with the same problem. Do you give me the points too if I found how to do this in delphi ?
0
 
LVL 3

Accepted Solution

by:
mirek071497 earned 200 total points
ID: 1348237
Hi

Mayby this is not very fine however this is working solution.

uses
  Registry;

procedure TForm1.Button1Click(Sender: TObject);
var
  reg : TRegistry;
  st  : string;
begin
  reg := TRegistry.Create;
  if reg.OpenKey('Control Panel\desktop\WindowMetrics', false) then
    begin
      st := reg.readstring('Shell Icon Size');
      reg.writestring( 'Shell Icon Size', IntToStr(StrToInt(st)+1) );
      SendMessage( hwnd_broadcast, WM_SETTINGCHANGE, 0, 0 );
      reg.writestring( 'Shell Icon Size', st );
    end;
  reg.free;
end;

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
creating manifest for my dll that called from activex 6 99
Best Firemonkey component pack 1 87
Communication Between RC4 Delphi <-> PHP 3 100
Run video youtube webbrowse 10 57
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now