[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I reload the icons on the desktop ?

Posted on 1997-10-19
5
Medium Priority
?
338 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 400 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

873 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