ebbsamsung
Registered User.
- Local time
- Today, 11:18
- Joined
- May 22, 2014
- Messages
- 19
Sir,
Here I am again for this problem, I adapted a code running in 32bit MS Access but now I faced this problem if possible to make this code runs in both 32bit and 64bit when they use this database. Is is possible like this?
If 64bit run this code else32bit run this code. How can I make it proper if its possible? Could you please help me?
Thank you in advance!
Here is the code:
Here I am again for this problem, I adapted a code running in 32bit MS Access but now I faced this problem if possible to make this code runs in both 32bit and 64bit when they use this database. Is is possible like this?
If 64bit run this code else32bit run this code. How can I make it proper if its possible? Could you please help me?

Thank you in advance!
Here is the code:
Code:
Option Compare Database
Option Explicit
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Private Const WM_SETICON = &H80
Private Const IMAGE_ICON = 1
Private Const LR_LOADFROMFILE = &H10
Private Const SM_CXSMICON As Long = 49
Private Const SM_CYSMICON As Long = 50
Private Declare Function LoadImage Lib "user32" Alias "LoadImageA" (ByVal hInst As Long, ByVal lpsz As String, ByVal un1 As Long, ByVal n1 As Long, ByVal n2 As Long, ByVal un2 As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Function SetFormIcon(hWnd As Long, strIconPath As String) As Boolean
Dim lIcon As Long
Dim lResult As Long
Dim X As Long, Y As Long
X = GetSystemMetrics(SM_CXSMICON)
Y = GetSystemMetrics(SM_CYSMICON)
lIcon = LoadImage(0, strIconPath, 1, X, Y, LR_LOADFROMFILE)
lResult = SendMessage(hWnd, WM_SETICON, 0, ByVal lIcon)
End Function