Hi,
I'm trying to show the notepad icon on my form. The code below is the result approach.
Anyway, it doesn't work... I don't know how to refer to the hInst and hDC (see question marks). It should be the application object and form object... I'm trying, trying...
Many thanx for any suggestions
key
Option Compare Database
Option Explicit
Declare Function DrawIcon Lib "user32.dll" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long
Declare Function DestroyIcon Lib "user32.dll" (ByVal hIcon As Long) As Long
Public Function display()
Dim hIcon As Long
Dim retval As Long
hIcon = ExtractIcon(????, "C:\Winnt\notepad.exe", 0)
retval = DrawIcon(????, 100, 75, hIcon)
retval = DestroyIcon(hIcon)
End Function
P. S. just one more thing: in VB you can use app.hInstance calling the ExtractIcon function....
I'm trying to show the notepad icon on my form. The code below is the result approach.
Anyway, it doesn't work... I don't know how to refer to the hInst and hDC (see question marks). It should be the application object and form object... I'm trying, trying...
Many thanx for any suggestions
key
Option Compare Database
Option Explicit
Declare Function DrawIcon Lib "user32.dll" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long
Declare Function DestroyIcon Lib "user32.dll" (ByVal hIcon As Long) As Long
Public Function display()
Dim hIcon As Long
Dim retval As Long
hIcon = ExtractIcon(????, "C:\Winnt\notepad.exe", 0)
retval = DrawIcon(????, 100, 75, hIcon)
retval = DestroyIcon(hIcon)
End Function
P. S. just one more thing: in VB you can use app.hInstance calling the ExtractIcon function....
Last edited: