Extracting an icon

ed209

Member
Joined
Jun 8, 2008
Messages
5
Programming Experience
1-3
I'm trying to extract an icon from an executable but I keep getting a type expected error.

Here is the code I got from teh MSDN library...

VB.NET:
 Dim ico As icon = Icon.ExtractAssociatedIcon("C:\WINDOWS\system32\notepad.exe")

Says a type is expected for 'icon'. oof.
 
Namespace: System.Drawing
Assembly: System.Drawing (in System.Drawing.dll)
So if you don't have that assembly referenced and that namespace imported then your program doesn't know what "icon" means.
 
Add reference with the "Add reference" dialog in Project menu. (or use context menu, or use References page in Project Properties pages).
You can't use the namespace before the reference is added.
 
Back
Top