How do change the caption(or any other property) of a button(or any other object) when the window is loaded or painted, etc,. (like in WndProc function)

The problem is that in WndProc function, I dont have the hwnd property of my button or any other child window. I just a the hwnd of main window