From 8f985884ea1dc888c44bd29b145a0845fc8776c8 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Sat, 13 Apr 2013 17:07:47 +0400 Subject: [PATCH] user32: Use defined constants to identify message box buttons. --- dlls/user32/msgbox.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/user32/msgbox.c b/dlls/user32/msgbox.c index 91437bc9244..9328cd0d432 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) { -- 2.11.4.GIT