Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1002507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:50:28+00:00 2026-05-16T07:50:28+00:00

I have a Delphi 2010 app which shows/hides the desktop icons under XP fine.

  • 0

I have a Delphi 2010 app which shows/hides the desktop icons under XP fine. However under my Window 7 test environment (happens to be 64 bit) the icons don’t disappear.

Here is the critical code I am using (for the hide):

ShowWindow(FindWindow(nil, 'Program Manager'), SW_HIDE );

I have found I can set the registry:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"HideIcons"=dword:00000001

And that works fine if I restart windows (or kill explorer and restart it), however is there a way to get the old code to work and/or tell the desktop to reload using the new registry information without such radical methods.

Thank in advance.

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T07:50:29+00:00Added an answer on May 16, 2026 at 7:50 am

    Ok, here is the revised hackish method (sorry Alexander!):

    var
    DeskHandle : HWND;
    
    ...
    
    ///////////////////////////////////////////////////////////////////////
    // Callback function for EnumWindows
    ///////////////////////////////////////////////////////////////////////
    function MyGetWindow (Handle: HWND; NotUsed: longint): bool; stdcall;
    var
      hChild : HWND;
    begin
      if handle <> 0 then
      begin
        hChild := FindWindowEx(handle, 0, 'SHELLDLL_DefView' ,nil);
        if hChild <> 0 then
        begin
          hChild := FindWindowEx(hChild, 0, 'SysListView32' ,nil);
          if hChild <> 0 then
          begin
            DeskHandle := hChild;
          end;
        end;
      end;
      result := TRUE;
    end;
    
    procedure ShowDesktopIcons(const Show : boolean) ;
    begin
      DeskHandle := 0;
      EnumWindows(@MyGetWindow, 0);
    
      if DeskHandle <> 0 then
      begin
        if Show then
        begin
          ShowWindow(DeskHandle, SW_SHOW );
        end
        else
        begin
          ShowWindow(DeskHandle, SW_HIDE );
        end;
      end;
    end;
    

    The issue arises because parent/child relationship between “Progman” and SysListView32 has changed from XP to Vista/Win7 (precisely why you shouldn’t use a hack ;-). In addition, applying a theme with multiple pictures under Win7 (my test environment) changes this relationship even further. Therefore the new routine looks through all windows until it finds one with a “SHELLDLL_DefView” and “SysListView32” child set under one. It then returns the handle of SysListView32 in the global variable DeskHandle. Not elegant, not sure to work in future code, but works today.

    If anyone can get a SHGetSetSettings version to work, that is definitely the correct way to go, not this junk.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Delphi 2010 Windows 7 - 64 bit. I have an app which is reasonably
I have updated an application from Delphi 2007 to Delphi 2010, everything went fine,
I have a Delphi 2010 DLL loaded in a Delphi 2010 app. It works
We have an application written in Delphi 2010 which connects to SQL Server Database.
I have a Delphi 2007 Program, which calls a Delphi 2010 DLL. The Program
does Delphi 2010 have C# Style XML comments that show up when hovering over
I have just installed Delphi 2010 and got some troubles with idHTTP component. If
In Delphi 2010, I have placed 2 radio groups onto a form then added
I have started using of generics in Delphi 2010 but I have a problem
I have been experimenting with TMask in Delphi 2010 and it seems to work

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.