Board index » delphi » Any way to make all desktop icons dissappear?

Any way to make all desktop icons dissappear?

Sometimes when I run a program that doesn't take up the full screen
I'd like to be able to make the Windows desktop icons dissappear for
the duration of time that the program is running.  Is this possible?
 

Re:Any way to make all desktop icons dissappear?


Yes, it is.

You can use the ShowWindow function.

Gunnar Martensen

Dave Alden skrev i meddelelsen <37a5dd71.21406...@news.concentric.net>...

Quote
>Sometimes when I run a program that doesn't take up the full screen
>I'd like to be able to make the Windows desktop icons dissappear for
>the duration of time that the program is running.  Is this possible?

Re:Any way to make all desktop icons dissappear?


On Tue, 3 Aug 1999 21:33:48 +0200, "Gunnar Martensen" <gm-d...@post3.tele.dk>
wrote:

Quote
>Yes, it is.
>You can use the ShowWindow function.

HOW?
I mean what handle, name, process do i look for?!

T.

Re:Any way to make all desktop icons dissappear?


Quote
TW <TWin...@Casema.Net> wrote in message

news:37a75ff4.103386126@news.casema.net...

Quote
> On Tue, 3 Aug 1999 21:33:48 +0200, "Gunnar Martensen" <gm-d...@post3.tele.dk>
> wrote:
> >Yes, it is.
> >You can use the ShowWindow function.

> HOW?
> I mean what handle, name, process do i look for?!

var
  DesktopWnd : HWND;

procedure TForm1.Button1Click(Sender: TObject);
begin
  DesktopWnd := FindWindow('Progman', 'Program Manager');
  if DesktopWnd > 0 then begin
    DesktopWnd := FindWindowEx(DesktopWnd, 0, 'SHELLDLL_DefView', nil);

    if DesktopWnd > 0 then
      DesktopWnd := FindWindowEx(DesktopWnd, 0, 'SysListView32', nil);
  end;

  if DesktopWnd = 0 then
    ShowMessage('Error - could not find desktop')
  else
    ShowWindow(DesktopWnd, SW_HIDE);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  if DesktopWnd > 0 then
    ShowWindow(DesktopWnd, SW_SHOW);
end;

Button1 hides the icons, Button2 shows 'em again. You can have even more
fun with SetWindowLong and the various LVS_ constants, but I'll leave that
to you...

BTW why on earth should an application need to hide the desktop icons
anyway?

--
Jeremy Collins
Kansai Business Systems
http://www.kansai.co.uk/

Re:Any way to make all desktop icons dissappear?


Thanks for the procedure!  sometimes all those Icons on the desktop
just clutter up the screen.  Nice to be able to get rid of them
temporarily.

On Wed, 4 Aug 1999 09:37:26 +0100, "Jeremy Collins"

Quote
<jer...@kansai.co.uk> wrote:

>TW <TWin...@Casema.Net> wrote in message
>news:37a75ff4.103386126@news.casema.net...
>> On Tue, 3 Aug 1999 21:33:48 +0200, "Gunnar Martensen" <gm-d...@post3.tele.dk>
>> wrote:
>> >Yes, it is.
>> >You can use the ShowWindow function.

>> HOW?
>> I mean what handle, name, process do i look for?!

>var
>  DesktopWnd : HWND;

>procedure TForm1.Button1Click(Sender: TObject);
>begin
>  DesktopWnd := FindWindow('Progman', 'Program Manager');
>  if DesktopWnd > 0 then begin
>    DesktopWnd := FindWindowEx(DesktopWnd, 0, 'SHELLDLL_DefView', nil);

>    if DesktopWnd > 0 then
>      DesktopWnd := FindWindowEx(DesktopWnd, 0, 'SysListView32', nil);
>  end;

>  if DesktopWnd = 0 then
>    ShowMessage('Error - could not find desktop')
>  else
>    ShowWindow(DesktopWnd, SW_HIDE);
>end;

>procedure TForm1.Button2Click(Sender: TObject);
>begin
>  if DesktopWnd > 0 then
>    ShowWindow(DesktopWnd, SW_SHOW);
>end;

>Button1 hides the icons, Button2 shows 'em again. You can have even more
>fun with SetWindowLong and the various LVS_ constants, but I'll leave that
>to you...

>BTW why on earth should an application need to hide the desktop icons
>anyway?

Other Threads