D
David De La PEÑA
Hi,
I'm trying to subclass a LV in an Access Form.
First I use 'fGetClientHandle' function to get a handle to the client
window, but it doesnt work it returns 0!!!
Function fGetClientHandle(frm As Form) As Long
' Returns a handle to the client window of a form
' An Access form's hWnd is actually bound to the
' recordselector "window"
'
Dim hWnd As Long
Dim tmpHwnd As Long
' get the first child window of the form
hWnd = apiGetWindow(frm.hWnd, GW_CHILD)
' iterate through all child windows of the form
Do While hWnd
' if we locate the client area whose class name is "OFormSub"
If fGetClassName(hWnd) = ACC_FORM_CLIENT_CLASS Then
' the Client window's child is a window with the class
' name of OFEDT, so just verify that we're looking at the
' right window
tmpHwnd = apiGetWindow(hWnd, GW_CHILD)
fGetClientHandle = hWnd
Exit Do
If fGetClassName(tmpHwnd) = _
ACC_FORM_CLIENT_CHILD_CLASS Then
' if we found a match, then return
' the handle and we're outta here.
fGetClientHandle = hWnd
Exit Do
End If
End If
' get a handle to the next child window
hWnd = apiGetWindow(hWnd, GW_HWNDNEXT)
Loop
End Function
Any idea?
And after that how to get an hwnd of a control set in this form? How to
iterate throught them to get it?
I'm trying to subclass a LV in an Access Form.
First I use 'fGetClientHandle' function to get a handle to the client
window, but it doesnt work it returns 0!!!
Function fGetClientHandle(frm As Form) As Long
' Returns a handle to the client window of a form
' An Access form's hWnd is actually bound to the
' recordselector "window"
'
Dim hWnd As Long
Dim tmpHwnd As Long
' get the first child window of the form
hWnd = apiGetWindow(frm.hWnd, GW_CHILD)
' iterate through all child windows of the form
Do While hWnd
' if we locate the client area whose class name is "OFormSub"
If fGetClassName(hWnd) = ACC_FORM_CLIENT_CLASS Then
' the Client window's child is a window with the class
' name of OFEDT, so just verify that we're looking at the
' right window
tmpHwnd = apiGetWindow(hWnd, GW_CHILD)
fGetClientHandle = hWnd
Exit Do
If fGetClassName(tmpHwnd) = _
ACC_FORM_CLIENT_CHILD_CLASS Then
' if we found a match, then return
' the handle and we're outta here.
fGetClientHandle = hWnd
Exit Do
End If
End If
' get a handle to the next child window
hWnd = apiGetWindow(hWnd, GW_HWNDNEXT)
Loop
End Function
Any idea?
And after that how to get an hwnd of a control set in this form? How to
iterate throught them to get it?