Private Declare Function ExtractAssociatedIcon Lib "shell32.dll" Alias "ExtractAssociatedIconA" (ByVal hInst As Long, ByVal lpIconPath As String, lpiIcon As Long) As Long
Private Declare Function DrawIconEx Lib "user32" (ByVal hDC As Long, ByVal xLeft As Long, ByVal yTop As Long, ByVal hIcon As Long, ByVal cxWidth As Long, ByVal cyWidth As Long, ByVal istepIfAniCur As Long, ByVal hbrFlickerFreeDraw As Long, ByVal diFlags As Long) As Long
Private Declare Function DestroyIcon Lib "user32" (ByVal hIcon As Long) As Long
Private Sub Form_Load()
Option2_Click
End Sub
Private Sub Option1_Click()
Dim hIcon As Long
Picture1.Cls
hIcon = ExtractAssociatedIcon(App.hInstance, "explorer.exe", 0)
DrawIconEx Picture1.hDC, 16, 16, hIcon, 16, 16, 0, 0, &H1 Or &H3
DestroyIcon hIcon
End Sub
Private Sub Option2_Click()
Dim hIcon As Long
Picture1.Cls
hIcon = ExtractAssociatedIcon(App.hInstance, "explorer.exe", 0)
DrawIconEx Picture1.hDC, 0, 0, hIcon, 32, 32, 0, 0, &H1 Or &H3
DestroyIcon hIcon
End Sub