Stephen Lebans said:
Post your code that gets the Icon, including all API
declarations/constants etc.
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
To test IT i use only your Form, i CLEAN all cmdButton, i store
only Load_Event Code and Unload......!!
I put only ONE cmdButton Comando1(Italian version of Command1)
Thanks in advance.
Alessandro(IT)
This is the code:
Option Compare Database
Option Explicit
Const GWL_HINSTANCE = (-6)
Private Declare Function GetWindowDC Lib "user32" _
(ByVal hWnd As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
(ByVal hWnd As Long, ByVal nIndex As Long) As Long
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 ExtractIcon Lib "shell32.dll" _
Alias "ExtractIconA" _
(ByVal hInst As Long, _
ByVal lpszExeFileName As String, _
ByVal nIconIndex As Long) As Long
Private Declare Function ExtractAssociatedIcon Lib "shell32.dll" _
Alias "ExtractAssociatedIconA" _
(ByVal hInst As Long, _
ByVal lpIconPath As String, _
ByRef lpiIcon As Integer) As Long
Private Declare Function GetFocus Lib "user32" _
() As Long
Private Declare Function DestroyIcon Lib "user32" _
(ByVal hIcon As Long) As Long
' Our PictureBox class
Private pb As clsPictureBox
' For scaling function
Private ScaleAmt As Single
Private Type POINTAPI
x As Long
y As Long
End Type
Private Sub Form_Load()
DoCmd.MoveSize 0, 0, 10500, 6350
' Realize an instance of our class
Set pb = New clsPictureBox
' You MUST set the ImageControl prop
pb.ImageControl = Me.Image0
' You MUST set the ImageForm prop
pb.ImageForm = Me
' Clear the Image control to FillColor
pb.Clear
' Set Unbound Text control
' Set our module Scale variable
ScaleAmt = 1
' Draw some text
pb.OutputText "TEST"
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set pb = Nothing
End Sub
Sub ApriIconDaDll()
Dim Percorso As String
Dim hInst As Long
Dim hIcon As Long
hInst = GetWindowLong(Application.hWndAccessApp, GWL_HINSTANCE)
Percorso = "D:\FileZilla_2_2_3_setup.exe"
hIcon = ExtractAssociatedIcon(hInst, Percorso, CLng(0))
DrawIcon pb.hdc, 0, 0, hIcon
DestroyIcon hIcon
End Sub
Private Sub Comando1_Click()
ApriIconDaDll
End Sub