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
ddb4be2b
Commit
ddb4be2b
authored
Jun 22, 2007
by
Markus Gömmel
Committed by
Alexandre Julliard
Jul 02, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Center MessageBox dialogs to desktop, as Windows does.
parent
f281d0e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
msgbox.c
dlls/user32/msgbox.c
+12
-4
No files found.
dlls/user32/msgbox.c
View file @
ddb4be2b
...
@@ -70,9 +70,11 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
...
@@ -70,9 +70,11 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
HWND
hItem
;
HWND
hItem
;
HDC
hdc
;
HDC
hdc
;
int
i
,
buttons
;
int
i
,
buttons
;
int
bspace
,
bw
,
bh
,
theight
,
tleft
,
wwidth
,
wheight
,
bpos
;
int
bspace
,
bw
,
bh
,
theight
,
tleft
,
wwidth
,
wheight
,
wleft
,
wtop
,
bpos
;
int
borheight
,
borwidth
,
iheight
,
ileft
,
iwidth
,
twidth
,
tiheight
;
int
borheight
,
borwidth
,
iheight
,
ileft
,
iwidth
,
twidth
,
tiheight
;
NONCLIENTMETRICSW
nclm
;
NONCLIENTMETRICSW
nclm
;
HMONITOR
monitor
=
0
;
MONITORINFO
mon_info
;
LPCWSTR
lpszText
;
LPCWSTR
lpszText
;
WCHAR
buf
[
256
];
WCHAR
buf
[
256
];
...
@@ -244,9 +246,15 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
...
@@ -244,9 +246,15 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
wwidth
=
tleft
+
twidth
+
ileft
+
borwidth
;
wwidth
=
tleft
+
twidth
+
ileft
+
borwidth
;
wheight
=
8
+
tiheight
+
bh
+
borheight
;
wheight
=
8
+
tiheight
+
bh
+
borheight
;
/* Resize the window */
/* Message boxes are always desktop centered, so query desktop size and center window */
SetWindowPos
(
hwnd
,
0
,
0
,
0
,
wwidth
,
wheight
,
monitor
=
MonitorFromWindow
(
lpmb
->
hwndOwner
?
lpmb
->
hwndOwner
:
GetActiveWindow
(),
MONITOR_DEFAULTTOPRIMARY
);
SWP_NOMOVE
|
SWP_NOZORDER
|
SWP_NOACTIVATE
|
SWP_NOREDRAW
);
GetMonitorInfoW
(
monitor
,
&
mon_info
);
wleft
=
(
mon_info
.
rcWork
.
left
+
mon_info
.
rcWork
.
right
-
wwidth
)
/
2
;
wtop
=
(
mon_info
.
rcWork
.
top
+
mon_info
.
rcWork
.
bottom
-
wheight
)
/
2
;
/* Resize and center the window */
SetWindowPos
(
hwnd
,
0
,
wleft
,
wtop
,
wwidth
,
wheight
,
SWP_NOZORDER
|
SWP_NOACTIVATE
|
SWP_NOREDRAW
);
/* Position the icon */
/* Position the icon */
SetWindowPos
(
GetDlgItem
(
hwnd
,
MSGBOX_IDICON
),
0
,
ileft
,
(
tiheight
-
iheight
)
/
2
,
0
,
0
,
SetWindowPos
(
GetDlgItem
(
hwnd
,
MSGBOX_IDICON
),
0
,
ileft
,
(
tiheight
-
iheight
)
/
2
,
0
,
0
,
...
...
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