Can I get the handle of a window?
-
If I got the handle of a application instance, can I get all of its windows' handles? Please help me:confused: Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
If I got the handle of a application instance, can I get all of its windows' handles? Please help me:confused: Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
Handle of application instance? The one passed to WinMain? Tomasz Sowinski -- http://www.shooltz.com
-
Handle of application instance? The one passed to WinMain? Tomasz Sowinski -- http://www.shooltz.com
Yes, it is. Can I get the handle? Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
If I got the handle of a application instance, can I get all of its windows' handles? Please help me:confused: Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
It works fine. Thank you very much!:) But I think enumeration's performance isn't very high. Are there any other solutions?:rolleyes: Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
-
Yes, it is. Can I get the handle? Law is meaningless without chaos. Chaos without Law is equal to destruction. Chaos and Law create our rich and colorful world.
Application instance handle will be useless; it's provided for backward compatibility (all processes see identical value). You'll have to get a process ID instead. Then, as Norm suggested, you should use EnumWindows. For each window call GetWindowThreadProcessId and compare the IDs. Note that this technique gives you handles of toplevel windows; if you want their child you'll have to use EnumChildWindows. Tomasz Sowinski -- http://www.shooltz.com