Solved

How do I reload the icons on the desktop ?

Posted on 1997-10-19
5
334 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@
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Using idhttp to login to instagram 2 119
Delphi: ForceDirectory plain function 7 50
SUM 2 INTEGER ARRAYS INTO 1 10 111
How to Get Images From Server using App Tethering 11 42
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…

733 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