

Of course, all this is happening when executing the code with Ctrl + F5.

MessageBeep(-1) in WM_PAINT, and I can hear the sound. I know the window is being painted, for I inserted a That means, if I call SetWindowText() before the initialization of the variableĪ, the window title is shown correctly, although it doesn't show any text on its client area, when the window gets painted. LRESULT CALLBACK WndProc (HWND hwnd, UINT message, UINT wParam, LONG lParam) And that occurs after the first initialization of a static std::auto_ptr object like the pseudo-code below : It's also interesting to mention that everything that is printed in WMPAINT comes from class A objects allocated on the heap, whose addresses are encapsulated in std::autoptr objects. When the program is launched with F5 everything works fine.

WM_CREATE, to see exactly where it failed to exhibit the window's title. Of course, all this is happening when executing the code with Ctrl + F5. I then started moving backwards this function call, within SetWindowText(hwnd, L"Any Title") at the end of the WM_CREATE message processing. Remember what I said above, that the window title doesn't show on the app window, and this title is set up with Std::auto_ptr objects with its reset() member function. After many hours working on this, I found out that the problem somehow is related to the initialization of static
