VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Display pick icon dialog using PickIconDlg API

by Karthikeyan (187 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Thu 18th January 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Display pick icon dialog using PickIconDlg API

API Declarations


Private Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long
Private Declare Function DrawIcon Lib "user32.dll" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
Private Declare Function DestroyIcon Lib "user32.dll" (ByVal hIcon As Long) As Long


Rate Display pick icon dialog using PickIconDlg API



Dim fname As String
Dim index As Long
Dim hIcon As Long
Dim rval As Long
fname = "C:\windows\explorer.exe"
index = 2
rval = PickIconDlg(Form1.hwnd, fname, Len(fname), index)
If rval Then
hIcon = ExtractIcon(App.hInstance, fname, index)
Form1.Cls
rval = DrawIcon(Form1.hDC, 60, 10, hIcon)
rval = DestroyIcon(hIcon)
End If
End Sub
Private Sub Command2_Click()
End
End Sub

Download this snippet    Add to My Saved Code

Display pick icon dialog using PickIconDlg API Comments

No comments have been posted about Display pick icon dialog using PickIconDlg API. Why not be the first to post a comment about Display pick icon dialog using PickIconDlg API.

Post your comment

Subject:
Message:
0/1000 characters