I can get handles using mouse location by clicking. But i need to find handles of all controls on a window using it's classname without clicking. I have to get them, while the window opened. Is it possible?
Asked
Active
Viewed 2,086 times
2 Answers
1
you can combine two popular API's:
[DllImport("user32.Dll")]
private static extern Boolean EnumChildWindows(int hWndParent, PChildCallBack lpEnumFunc, int lParam);
This function is for getting all "child" windows inside a window. The second one is
[DllImport("User32.Dll")]
private static extern void GetClassName(int hWnd, StringBuilder s, int nMaxCount);
Use this method to filter whether the enummed window has a specific class name.
Happy coding!

George Lica
- 1,798
- 1
- 12
- 23
0
Yes, you need to use a variety of API calls, starting with EnumWindows and probably GetClassName as well.

Lloyd
- 29,197
- 4
- 84
- 98