user32: Use defined constants to identify message box buttons.
This commit is contained in:
parent
e1c884256e
commit
8f985884ea
@ -86,11 +86,11 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
|
|||||||
SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0);
|
SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0);
|
||||||
hFont = CreateFontIndirectW (&nclm.lfMessageFont);
|
hFont = CreateFontIndirectW (&nclm.lfMessageFont);
|
||||||
/* set button font */
|
/* set button font */
|
||||||
for (i=1; i < 12; i++)
|
for (i = IDOK; i <= IDCONTINUE; i++)
|
||||||
/* No button 8 (Close) */
|
/* no close button */
|
||||||
if (i != 8) {
|
if (i != IDCANCEL)
|
||||||
SendDlgItemMessageW (hwnd, i, WM_SETFONT, (WPARAM)hFont, 0);
|
SendDlgItemMessageW (hwnd, i, WM_SETFONT, (WPARAM)hFont, 0);
|
||||||
}
|
|
||||||
/* set text font */
|
/* set text font */
|
||||||
SendDlgItemMessageW (hwnd, MSGBOX_IDTEXT, WM_SETFONT, (WPARAM)hFont, 0);
|
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 */
|
/* Get the number of visible buttons and their size */
|
||||||
bh = bw = 1; /* Minimum button sizes */
|
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);
|
hItem = GetDlgItem(hwnd, i);
|
||||||
if (GetWindowLongW(hItem, GWL_STYLE) & WS_VISIBLE)
|
if (GetWindowLongW(hItem, GWL_STYLE) & WS_VISIBLE)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user