Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
7e874aed
Commit
7e874aed
authored
Apr 15, 2014
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Load the message box font through the dialog template.
parent
03167b43
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
24 deletions
+6
-24
msgbox.c
dlls/user32/msgbox.c
+5
-23
user32.rc
dlls/user32/user32.rc
+1
-1
No files found.
dlls/user32/msgbox.c
View file @
7e874aed
...
...
@@ -61,9 +61,9 @@ static BOOL CALLBACK MSGBOX_EnumProc(HWND hwnd, LPARAM lParam)
return
TRUE
;
}
static
HFONT
MSGBOX_OnInit
(
HWND
hwnd
,
LPMSGBOXPARAMSW
lpmb
)
static
void
MSGBOX_OnInit
(
HWND
hwnd
,
LPMSGBOXPARAMSW
lpmb
)
{
HFONT
h
Font
=
0
,
hPrevFont
=
0
;
HFONT
h
PrevFont
;
RECT
rect
;
HWND
hItem
;
HDC
hdc
;
...
...
@@ -84,15 +84,6 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
nclm
.
cbSize
=
sizeof
(
nclm
);
SystemParametersInfoW
(
SPI_GETNONCLIENTMETRICS
,
0
,
&
nclm
,
0
);
hFont
=
CreateFontIndirectW
(
&
nclm
.
lfMessageFont
);
/* set button font */
for
(
i
=
IDOK
;
i
<=
IDCONTINUE
;
i
++
)
/* no close button */
if
(
i
!=
IDCLOSE
)
SendDlgItemMessageW
(
hwnd
,
i
,
WM_SETFONT
,
(
WPARAM
)
hFont
,
0
);
/* set text font */
SendDlgItemMessageW
(
hwnd
,
MSGBOX_IDTEXT
,
WM_SETFONT
,
(
WPARAM
)
hFont
,
0
);
if
(
!
IS_INTRESOURCE
(
lpmb
->
lpszCaption
))
{
SetWindowTextW
(
hwnd
,
lpmb
->
lpszCaption
);
...
...
@@ -229,8 +220,7 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
iwidth
=
rect
.
right
-
ileft
;
hdc
=
GetDC
(
hwnd
);
if
(
hFont
)
hPrevFont
=
SelectObject
(
hdc
,
hFont
);
hPrevFont
=
SelectObject
(
hdc
,
(
HFONT
)
SendMessageW
(
hwnd
,
WM_GETFONT
,
0
,
0
));
/* Get the number of visible buttons and their size */
bh
=
bw
=
1
;
/* Minimum button sizes */
...
...
@@ -270,8 +260,7 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
twidth
=
max
((
bw
+
bspace
)
*
buttons
+
bspace
-
tleft
,
rect
.
right
);
theight
=
rect
.
bottom
;
if
(
hFont
)
SelectObject
(
hdc
,
hPrevFont
);
SelectObject
(
hdc
,
hPrevFont
);
ReleaseDC
(
hwnd
,
hdc
);
tiheight
=
16
+
max
(
iheight
,
theight
);
...
...
@@ -319,7 +308,6 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
SetWindowPos
(
hwnd
,
HWND_TOP
,
0
,
0
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOMOVE
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
return
hFont
;
}
...
...
@@ -331,15 +319,12 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
static
INT_PTR
CALLBACK
MSGBOX_DlgProc
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
HFONT
hFont
;
switch
(
message
)
{
case
WM_INITDIALOG
:
{
LPMSGBOXPARAMSW
mbp
=
(
LPMSGBOXPARAMSW
)
lParam
;
SetWindowContextHelpId
(
hwnd
,
mbp
->
dwContextHelpId
);
hFont
=
MSGBOX_OnInit
(
hwnd
,
mbp
);
SetPropA
(
hwnd
,
"WINE_MSGBOX_HFONT"
,
hFont
);
MSGBOX_OnInit
(
hwnd
,
mbp
);
SetPropA
(
hwnd
,
"WINE_MSGBOX_HELPCALLBACK"
,
mbp
->
lpfnMsgBoxCallback
);
break
;
}
...
...
@@ -356,10 +341,7 @@ static INT_PTR CALLBACK MSGBOX_DlgProc( HWND hwnd, UINT message,
case
IDNO
:
case
IDTRYAGAIN
:
case
IDCONTINUE
:
hFont
=
GetPropA
(
hwnd
,
"WINE_MSGBOX_HFONT"
);
EndDialog
(
hwnd
,
wParam
);
if
(
hFont
)
DeleteObject
(
hFont
);
break
;
case
IDHELP
:
FIXME
(
"Help button not supported yet
\n
"
);
...
...
dlls/user32/user32.rc
View file @
7e874aed
...
...
@@ -72,7 +72,7 @@ STRINGTABLE
}
MSGBOX DIALOG 100, 80, 216, 168
STYLE DS_MODALFRAME | DS_NOIDLEMSG | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
STYLE DS_MODALFRAME | DS_NOIDLEMSG |
DS_SETFONT |
WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
BEGIN
ICON "", MSGBOX_IDICON, 8, 20, 16, 16, WS_CHILD | WS_VISIBLE
LTEXT "", MSGBOX_IDTEXT, 32, 4, 176, 48, WS_CHILD | WS_VISIBLE | WS_GROUP | SS_NOPREFIX
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment