http://www.makepovertyhistory.org

Win32 window title.

I do not know at what point my Win32 window creation code changed but I have been trying to track a bug which until just now I was unable to find the source. I sub-class the window to allow the message procedure function to be a class member and therefore attaching the this pointer in CreateWindowEx. I had the correct flags set for the style so that the window had a title bar, yet the title was not being shown and the only way I could hack around it was to send a WM_SETTEXT to the window. The problem was due to the handling of the WM_NCCREATE message.The msdn documents state:

If an application processes this message, it should return TRUE to continue creation of the window. If the application returns FALSE, the CreateWindow or CreateWindowEx function will return a NULL handle.

What if fails to state is that the message needs to be passed to the default window procedure or a window title is not shown. I do not know if this is the only side effect which happens but it was the only noticeable one I could find.

Leave a Reply