Hi,
You can use the ExtractAssociatedIcon API in VB.net to get a handle to an
icon. Here is how you should declare it in VB.net.
Declare Function ExtractAssociatedIcon Lib "shell32.dll" Alias
"ExtractAssociatedIconA" (ByVal hInst As IntPtr, ByVal lpIconPath As
String, ByRef lpiIcon As Integer) As IntPtr
You need to use the IntPtr data type whenver a handle is expected in a API.
Also instead of long, use the Integer data type.
You can call the API as follows
Dim y as IntPtr
y = ExtractAssociatedIcon(Process.GetCurrentProcess().Handle, "c:\program
files\microsoft office\office10\excel.exe", 1)
Once you get the handle, you can use it in other API's and also you can
check you the System.Drawing.Icon class.
Hope this helps.
Anand Balasubramanian
Microsoft, Visual Basic .NET
This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks