Nikolay Sivov : user32: Use defined constants to identify message box buttons.
Alexandre Julliard
julliard at winehq.org
Mon Apr 15 13:09:40 CDT 2013
Module: wine
Branch: master
Commit: 8f985884ea1dc888c44bd29b145a0845fc8776c8
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8f985884ea1dc888c44bd29b145a0845fc8776c8
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Sat Apr 13 17:07:47 2013 +0400
user32: Use defined constants to identify message box buttons.
---
dlls/user32/msgbox.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/user32/msgbox.c b/dlls/user32/msgbox.c
index 91437bc..9328cd0 100644
--- a/dlls/user32/msgbox.c
+++ b/dlls/user32/msgbox.c
@@ -86,11 +86,11 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0);
hFont = CreateFontIndirectW (&nclm.lfMessageFont);
/* set button font */
- for (i=1; i < 12; i++)
- /* No button 8 (Close) */
- if (i != 8) {
+ for (i = IDOK; i <= IDCONTINUE; i++)
+ /* no close button */
+ if (i != IDCANCEL)
SendDlgItemMessageW (hwnd, i, WM_SETFONT, (WPARAM)hFont, 0);
- }
+
/* set text font */
SendDlgItemMessageW (hwnd, MSGBOX_IDTEXT, WM_SETFONT, (WPARAM)hFont, 0);
@@ -234,9 +234,9 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
/* Get the number of visible buttons and their size */
bh = bw = 1; /* Minimum button sizes */
- for (buttons = 0, i = 1; i < 12; i++)
+ for (buttons = 0, i = IDOK; i <= IDCONTINUE; i++)
{
- if (i == 8) continue; /* No CLOSE button */
+ if (i == IDCLOSE) continue; /* No CLOSE button */
hItem = GetDlgItem(hwnd, i);
if (GetWindowLongW(hItem, GWL_STYLE) & WS_VISIBLE)
{
More information about the wine-cvs
mailing list