Under what circumstances will a dialog box not use the caption specified in the resource file?
Could it be space aliens?
Under what circumstances will a dialog box not use the caption specified in the resource file? In particular, we have a modal dialog box that is not using the caption from the resource file. Even if we explicitly call
SetWindowTextfrom within the
WM_INITDIALOGhandler, the call succeeds but the caption remains unchanged.
The dialog box’s initial title is the value specified in the resource template. And if you set it again in the
WM_INITDIALOG handler, then that new title overwrites the title from the resource template. Perhaps the problem is that some other code that runs after your
WM_INITDIALOG handler is changing the title yet again.
The customer sheepishly wrote back,
[banging head against the wall]
Being skeptical that there could ever be anything else overwriting the code I went to debug with Spy++. After some considerable effort I found out that yes, further down ~30 lines there’s a call to
SetWindowTextthat changes the title to something else.
Thanks for making me look again.