Solved

How do I reload the icons on the desktop ?

Posted on 1997-10-19
5
333 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

808 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