View Single Post
  #4 (permalink)  
Old 02-28-2009, 09:38 AM
agraham's Avatar
agraham agraham is offline
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Quote:
Originally Posted by Byak@ View Post
get the icon from exe?
Like this, which only works in .NET 2.0 or later and only on the desktop. Obj1 is a Door library Object.
Code:
Obj1.New1(False)
' create a new empty Icon
Obj1.CreateNew("System.Drawing.Icon" & Obj1.System_Drawing)
' get an Icon from a file
Obj1.Value = Obj1.RunMethod2("ExtractAssociatedIcon","C:\WINDOWS\system32\notepad.exe""System.String")
' add it to an ControlsExDesktop IconList
IconList.AddIcon(Obj1.Value)
' or turn it into a bitmap
Image1.Image = Obj1.RunMethod("ToBitmap")    
' alternatively
Image1.Image = IconList.ItemBitmap(0)
Reply With Quote