PC Review


Reply
Thread Tools Rate Thread

Adding MyComputer Icon to TreeView - Check code

 
 
SamSpade
Guest
Posts: n/a
 
      2nd Mar 2004
Below is how I add the drives to an explorer like TreeView.

What I don't know how to do is to add an Icon for MyComputer.

Any help would be appreciated.



Dim SysIconList% = WinApi.SHGetFileInfo(IntPtr.Zero, 0, SFI,
Marshal.SizeOf(SFI), Win32.Shell.SHGFI_SYSICONINDEX +
Win32.Shell.SHGFI_SMALLICON)

SendMessage(tvFolders.Handle, TVM_SETIMAGELIST, 0, SysIconList)

Dim MyComputerNode As TreeNode = tvFolders.Nodes.Add(mMY_COMPUTER)

'MyComputerNode.ImageIndex = ?????

For Each Drive As String In Directory.GetLogicalDrives() 'Add Logical Drives
into TreeView

winapi.SHGetFileInfo(Drive, 0, mSHI, mSHISize, Win32.Shell.SHGFI_ICON)

Dim Subnode As TreeNode = MyComputerNode.Nodes.Add(Split(Drive, "\")(0))

Subnode.ImageIndex = mSHI.iIcon

Next


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding icon, toggle btn, or check box to form control box farseer Microsoft Dot NET Framework Forms 2 8th Nov 2006 07:06 AM
Adding icon, toggle btn, or check box to form control box farseer Microsoft C# .NET 0 6th Nov 2006 06:03 AM
Need to find Icon for MyComputer SamSpade Microsoft VB .NET 2 12th Feb 2004 09:58 PM
drive icon not showing up in MyComputer Ralph P Windows XP Hardware 1 19th Aug 2003 08:35 AM
CD Icon (D: / drive) missing from MyComputer window Alex Brown Microsoft Windows 2000 File System 0 22nd Jul 2003 02:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:52 AM.