Hi LaVolpe! You are the best programmer I ve ever seen in my life! Thank you and Happy New Year! I have a problem, can you help me, please?
So, I have a module:
and Form Code:vb Code:
Public Declare Function ExtractAssociatedIcon Lib "shell32.dll" Alias "ExtractAssociatedIconA" (ByVal hInst As Long, ByVal lpIconPath As String, lpiIcon As Long) As Long Public Declare Function DrawIcon Lib "user32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long Public Declare Function DestroyIcon Lib "user32" (ByVal hIcon As Long) As Long
So, what is wrong in it? Or how can I paint associated icon to AlphaImgCtl1(hdc)? Please, can you help me to correct it? Thanks!vb Code:
Private Sub Command1_Click() CommonDialog1.ShowOpen Dim sPath As String, hIcon As Long, nIcon As Long sPath = CommonDialog1.FileName hIcon = ExtractAssociatedIcon(App.hInstance, sPath, nIcon) DrawIcon Picture1.hdc, 0&, 0&, hIcon AlphaImgCtl1.PaintImageAsDrawnToHDC (Picture1.hdc) DestroyIcon hIcon End Sub




Reply With Quote
