retrieve textbox Handle (1 Viewer)

KeithG

AWF VIP
Local time
Yesterday, 23:00
Joined
Mar 23, 2006
Messages
2,592
I am trying to use the EnumWindowsEX API to retrieve the handle to all of the controls of an Access form but the EnumWindowsEX fuction does not retrieve the handle for any of the controls? Also I know I am passing in the correct handle for the form. Are controls on an Access form actuall a seperate window therefore meaning they should have a handle I should be able to retrieve? Any thoughts are apperciated!
 

KeithG

AWF VIP
Local time
Yesterday, 23:00
Joined
Mar 23, 2006
Messages
2,592
Thanks for the link. When I tried the function it always brought back the same handle # for each control on the form. I guess each control in Access is not a seperate window. Is this tru for a VB application as well?
 

ByteMyzer

AWF VIP
Local time
Yesterday, 23:00
Joined
May 3, 2004
Messages
1,409
Please review the statement on the page from the link I provided:

The Access Web said:
Access controls are not standard VB controls. They're drawn on the screen at runtime. As such, unlike VB controls, they do not have a unique hWnd.

When an Access control on a form receives the focus, it becomes a true window and it's possible to retrieve it's handle by using the GetFocus API. Note that because Access controls do not behave like VB controls, there's not a whole lot that we can do with the hWnd.

Form controls in Microsoft Access are subclassed objects, differently rendered than standard VB form controls. When the form's focus changes from one control to the next, the new control inherits the window handle that was associated with the preceding control.

As such, EnumWindowsEX is not a feasible option with Access Form controls. What is it exactly that you are trying to accomplish with this?
 

KeithG

AWF VIP
Local time
Yesterday, 23:00
Joined
Mar 23, 2006
Messages
2,592
I want to retrieve information from a form from an executable file. I was testing this at home using Access but this won't work because each textbox does not have a unique handle. I am going to try to create a sample program with Visual Studio's and see if I retrieve the info from that form.Thanks for you help.
 

Users who are viewing this thread

Top Bottom