Draw Any Icon on form
Draw Any Icon on form
API Declarations
Private Declare Function DrawIcon Lib "user32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hicon As Long) As Long
Private Declare Function DestroyIcon Lib "user32" (ByVal hicon As Long) As Long
Dim hicon As Long ' Handle to icon
Dim rval As Long ' Return value
Dim index As Long 'Icon index
Rate Draw Any Icon on form
(1(1 Vote))
Private Sub Command1_Click()
index = 0
'Extract Icon from explorer.exe of index=0
'Give the path of any icon
hicon = ExtractIcon(App.hInstance, "c:\windows\WINUPD.ICO", index)
rval = DrawIcon(Form1.hdc, 150, 150, hicon) 'draw icon on form
rval = DestroyIcon(hicon) 'Destroy the icon handle
'Extract and Draw Icon for index=0
End Sub
Draw Any Icon on form Comments
No comments yet — be the first to post one!
Post a Comment