Question

Ok, so I have a Microsoft Access form which contains a textbox which I am trying to get a handle on from .Net

My form is below:

frmTest

Using Spy++, I have found my textbox handle. A screenshow is below:

Spy Plus

Is this handle unique to my PC or frmTest? As in, if I open frmTest on another computer will the handle for my textbox still be 001E1A6E?

Thanks

Was it helpful?

Solution

A window handle is allocated when the window gets created. If you run an application multiple times, an application window will get a new window handle every time. And if the application destroys and recreates the window, it'll get a new handle too.

The handle is unique across processes. i.e. you can pass a window handle to another application, and it will still be valid(unlike kernel handles). I'm not sure if they are unique per desktop, or per running instance of windows.


You should use the information from Spy++ to create a series of FindWindow(Ex) calls, that get the handle to the control you want.

OTHER TIPS

It is unique only for this instance of this window. If you completly exit MS Access, then start your app again, you will have another handle.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top