Member 11117223 wrote:
Thanks, but is the integer window handles the same each time or is it different for different process, threat, system, etc?
Window handles are system-wide. Unlike pointers which are different in the address spaces of different process, window handle (as well as other handles, atoms, etc.) are designed specifically to be shared between all processes. They are handles, not usual pointers.
And there is no "etc.". The unit of isolation is
application domain AppDomain
; and all processes are in separate application domains. The application domains have their separate address spaces; pointers/handles (even to the same object shared by different processes) can have different values in different address spaces; and if some addresses, by any change, have the same numeric values, they point to different objects in different application domains or processes. You can create more then on application domain per process, but this is a different story:
http://msdn.microsoft.com/en-us/library/system.appdomain%28v=vs.110%29.aspx[
^].
Now, as Dave Kreskowiak at and I tried to explain, the question makes no sense, but that's not all. If you think that you can rely on the property
Name
of control, think again. Those names are only important for the designer, are used to generate code, to figure out the names of the generated members. During runtime, there are insignificant. If you create controls in your own code, you don't need to use these names. Moreover, you can modify the during runtime (say, assign null to all of them), just to see that they don't play any role.
Therefore, you should never rely on those names. And of course, they don't even exist in raw Windows API you use through P/Invoke.
—SA