Not sure why you are creating a button in WM_NCCREATE - because the window on which the button will be displayed does not exist yet, therefore (as I assume), in the skin codes. WM_NCCREATE is sent to you when the "non-client" areas of the window are created (non-client areas, such as window border, title bar, etc.).
Do you need to place a button on a non-client area? If the answer is no, then why not create a button inside WM_CREATE.
If you need to create a button for any reason inside WM_NCCREATE, then why not save the window handle returned by calling Createwindow (). Then, inside your WM_CREATE message handler, grab this button window handle and make "MoveWindow (...)" on it using the application window, in which you should now have coordinates when you are in the WM_CREATE message handler.
I believe that one of the parameters that you can pass to the CreateWindow (...) call to create the button allows you to specify the βSW _...β flag, for example, βSW_HIDEβ if the memory is correct for me. So create, but donβt show the button in processing WM_NCCREATE if you need, and then when WM_CREATE comes quickly after that, do "MoveWindow (... window coordinates ... SW_SHOW, ......), etc. p. for positioning and creating a visible button.
wantTheBest
source share