http://bugs.winehq.org/show_bug.cgi?id=32594
Bug #: 32594 Summary: MessageBox hook WH_CBT HCBT_ACTIVATE sees wrong button size given MB_DEFBUTTON* style Product: Wine Version: 1.5.20 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: user32 AssignedTo: wine-bugs@winehq.org ReportedBy: staticinline@gmail.com Classification: Unclassified
MessageBox buttons are not correctly sized during the first call to a WH_CBT HCBT_ACTIVATE hook if a MB_DEFBUTTON* style is used on the message box.
Observe in the Wine msgbox.c:MSGBOX_OnInit code, the "position the buttons" loop iterates through each button, and if a button has a MB_DEFMASK set, it also calls SetFocus, which triggers the WH_CBT HCBT_ACTIVATE hook. This is before this loop positions the remaining buttons. The attached wine-msgbox-patch.txt is a patch to Wine 1.5.20 that positions all the buttons before processing the MB_DEFMASK.
This problem affects programs using the wxWidgets 2.9.x GUI library, whose message box implementation measures (via GetWindowRec) the initial sizes of the buttons during a WH_CBT HCBT_ACTIVATE hook [2]. This problem is analyzed more fully in a wxWidgets ticket [1].
The problem has also been observed to affect at least as far back as Wine 1.0.1 (debian squeeze, x86).
[1] http://trac.wxwidgets.org/ticket/14926 [2] http://trac.wxwidgets.org/browser/wxWidgets/trunk/src/msw/msgdlg.cpp#L369