Sunday, January 23, 2011

Show and Hide Desktop Icon

procedure ShowDesktopIcons(const Visible: Boolean);
var
h: THandle;
begin
h := FindWindow('ProgMan', nil);
if h = 0 then
RaiseLastOSError;
if Visible then
ShowWindow(h, SW_SHOW)
else
ShowWindow(h, SW_HIDE);
end;

procedure TForm1.btnHideClick(Sender: TObject);
begin
ShowDesktopIcons(False);
end;

procedure TForm1.btnShowClick(Sender: TObject);
begin
ShowDesktopIcons(True);
end;

Its work w/o restarting win explorer and 
this method works too in windows 7 , TESTED !!!

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Kang Iwan K-sev | Thank's for your visit To My Site - Ridwan Mulyana | Cibeureum