Delphi32.com - Home!
| Home/News | Downloads | Forums | D32 Magazine | Resources | Info and Facts |  
 
 Getting the Win95 Desktop ListView Handle


How do I get a handle to the Windows 95 Desktop to access the Desktop icons?   

    The Windows 95 Desktop is overlayed with a ListView component. You simply need to get a handle to the ListView.

    Example:
     function GetDesktopListViewHandle: THandle;
     var
       S: String;
     begin
     Result := FindWindow('ProgMan', nil);
     Result := GetWindow(Result, GW_CHILD);
     Result := GetWindow(Result, GW_CHILD);
     SetLength(S, 40);
     GetClassName(Result, PChar(S), 39);
     if PChar(S) <> 'SysListView32' then Result := 0;
     end;
    
    Once you have the handle, you can use the list view-related API functions in the CommCtrl unit to manipulate the desktop. See the LVM_xxxx messages in the Win32 online help. For example the following line of code: SendMessage(GetDesktopListViewHandle,LVM_ALIGN,LVA_ALIGNLEFT,0); will align the desktop icons to the left side of the Windows 95 desktop.

     



  << Previous Faq     Complete List     Next Faq >>  



 
 Hits/month  2,500,000+ 
 Downloads
 (Since May 2000)
 7,393,709 
 Total Files  6,023 
 Forum msgs  7,670 
 Articles/FAQs  70+/900+ 
Kylix
Tips n Tricks
FAQs
Knowledge Base
Bug Listings
Articles
Books
Newsgroups
Links
Submissions
Testimonials
Advertising
Contact Us
About Us
Search Amazon:
Top Selling Software at Amazon

| Home/News | Downloads | Forums | Resources | Info and Facts | Testimonials |
  Site Search:
 


Comments/Problems: Webmaster@delphi32.com
Copyright © 1998-2006, Delphi32.com. All rights reserved.
Terms of Use