Hello everyone.
First of all I want to introduce myself as I am new to this forum.
I am a Software developer who loves programming and who likes to learn a lot of languages. So I am in search of gathering basic knowledge for the most significant languages to have some basic clue in case I need them someday.

Now my question:

I'm learning to develop windows applications using WINAPI and plain C.
Now I got a bit confused with all those handles and would like to ask if you guys could teach me some good practices to structure and handle controls and windows.

Here's where I get confused:

Using the IDs declared in the resources for each object, we can get their handles using GetDlgItem(). Now what if we don't know their parent, which is needed by this function.

One example: We have the main window created at launch. Then we register two new window classes and create a window for each new class and we create a message function for each too. Now if inside one of the children windows I create a button and inside the other child window I create a text label. Now when we click the button inside of child window A the label in child window B shall be modified to whatever.

The WM_COMMAND for the button is interpreted inside the message loop for child window A. Now what would be the best and more elegant way to access the text label inside the child window B?

I am in the process of learning the WINAPI and just want to learn it right from the start instead of producing Hacked code that someday becomes unreadable and to later have to adapt to a new way of programing.

Thank you.