|
|
hWnd контрола в форме MS Access (API)
#If VBA7 Then
Private Declare PtrSafe Function GetFocusAPI Lib "user32" Alias "GetFocus" () As LongPtr
#Else
Private Declare Function GetFocusAPI Lib "user32" Alias "GetFocus" () As Long
#End If
Public Function GetControlWnd(ctrl As Control) As Long
On Error GoTo GetControlWnd_Err
ctrl.SetFocus
GetControlWnd = GetFocusAPI
GetControlWnd_Bye:
Exit Function
GetControlWnd_Err:
GetControlWnd = 0
MsgBox "Ошибка " & Err.Number & vbCrLf & Err.Description & vbCrLf & _
"в процедуре: GetControlWnd", vbCritical, "Error in module modGetControlWnd_API"
Resume GetControlWnd_Bye
End Function
|
|