Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
08c0ddec
Commit
08c0ddec
authored
Mar 20, 2009
by
Patrick Gauthier
Committed by
Alexandre Julliard
Mar 25, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Check effect of magic font height value 0x7fff in dialog template.
parent
28bc76b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
0 deletions
+95
-0
dialog.c
dlls/user32/tests/dialog.c
+95
-0
No files found.
dlls/user32/tests/dialog.c
View file @
08c0ddec
...
...
@@ -36,6 +36,7 @@
#include "wine/test.h"
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#define MAXHWNDS 1024
...
...
@@ -926,6 +927,99 @@ static void test_DisabledDialogTest(void)
ok
(
FALSE
==
g_terminated
,
"dialog with disabled ok button has been terminated
\n
"
);
}
static
INT_PTR
CALLBACK
messageBoxFontDlgWinProc
(
HWND
hDlg
,
UINT
uiMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
return
(
uiMsg
==
WM_INITDIALOG
);
}
static
void
test_MessageBoxFontTest
(
void
)
{
/* This dialog template defines a dialog template which got 0x7fff as its
* font size and omits the other font members. On WinNT, passing such a
* dialog template to CreateDialogIndirectParamW will result in a dialog
* being created which uses the message box font. We test that here.
*/
static
unsigned
char
dlgTemplate
[]
=
{
/* Dialog header */
0x01
,
0x00
,
/* Version */
0xff
,
0xff
,
/* Extended template marker */
0x00
,
0x00
,
0x00
,
0x00
,
/* Context Help ID */
0x00
,
0x00
,
0x00
,
0x00
,
/* Extended style */
0xc0
,
0x00
,
0xc8
,
0x80
,
/* Style (WS_SYSMENU|WS_CAPTION|WS_POPUP|DS_SETFONT|DS_MODALFRAME) */
0x01
,
0x00
,
/* Control count */
0x00
,
0x00
,
/* X */
0x00
,
0x00
,
/* Y */
0x80
,
0x00
,
/* Width */
0x80
,
0x00
,
/* Height */
0x00
,
0x00
,
/* Menu name */
0x00
,
0x00
,
/* Class name */
'T'
,
0x00
,
'e'
,
0x00
,
/* Caption (unicode) */
's'
,
0x00
,
't'
,
0x00
,
0x00
,
0x00
,
0xff
,
0x7f
,
/* Font height (0x7fff = message box font) */
/* Control #1 */
0x00
,
0x00
,
/* Align to DWORD (header is 42 bytes) */
0x00
,
0x00
,
0x00
,
0x00
,
/* Context Help ID */
0x00
,
0x00
,
0x00
,
0x00
,
/* Extended style */
0x00
,
0x00
,
0x00
,
0x50
,
/* Style (WS_CHILD|WS_VISIBLE) */
0x00
,
0x00
,
/* X */
0x00
,
0x00
,
/* Y */
0x80
,
0x00
,
/* Width */
0x80
,
0x00
,
/* Height */
0x00
,
0x01
,
0x00
,
0x00
,
/* Control ID (256) */
0xff
,
0xff
,
0x82
,
0x00
,
/* Class (Static) */
'W'
,
0x00
,
'I'
,
0x00
,
/* Caption (unicode) */
'N'
,
0x00
,
'E'
,
0x00
,
' '
,
0x00
,
'd'
,
0x00
,
'i'
,
0x00
,
'a'
,
0x00
,
'l'
,
0x00
,
'o'
,
0x00
,
'g'
,
0x00
,
' '
,
0x00
,
't'
,
0x00
,
'e'
,
0x00
,
's'
,
0x00
,
't'
,
0x00
,
'.'
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
/* Size of extended data */
0x00
,
0x00
/* Align to DWORD */
};
HWND
hDlg
;
HFONT
hFont
;
LOGFONTW
lfStaticFont
;
NONCLIENTMETRICSW
ncMetrics
;
/* Check if the dialog can be created from the template. On Win9x, this should fail
* because we are calling the W function which is not implemented, but that's what
* we want, because passing such a template to CreateDialogIndirectParamA would crash
* anyway.
*/
hDlg
=
CreateDialogIndirectParamW
(
g_hinst
,
(
LPCDLGTEMPLATE
)
dlgTemplate
,
NULL
,
messageBoxFontDlgWinProc
,
0
);
if
(
!
hDlg
)
{
todo_wine
win_skip
(
"dialog wasn't created
\n
"
);
return
;
}
hFont
=
(
HFONT
)
SendDlgItemMessageW
(
hDlg
,
256
,
WM_GETFONT
,
0
,
0
);
if
(
!
hFont
)
{
skip
(
"dialog uses system font
\n
"
);
DestroyWindow
(
hDlg
);
return
;
}
GetObjectW
(
hFont
,
sizeof
(
LOGFONTW
),
&
lfStaticFont
);
ncMetrics
.
cbSize
=
sizeof
(
NONCLIENTMETRICSW
);
SystemParametersInfoW
(
SPI_GETNONCLIENTMETRICS
,
0
,
&
ncMetrics
,
0
);
ok
(
!
memcmp
(
&
lfStaticFont
,
&
ncMetrics
.
lfMessageFont
,
FIELD_OFFSET
(
LOGFONTW
,
lfFaceName
))
&&
!
lstrcmpW
(
lfStaticFont
.
lfFaceName
,
ncMetrics
.
lfMessageFont
.
lfFaceName
),
"dialog doesn't use message box font
\n
"
);
DestroyWindow
(
hDlg
);
}
START_TEST
(
dialog
)
{
g_hinst
=
GetModuleHandleA
(
0
);
...
...
@@ -939,4 +1033,5 @@ START_TEST(dialog)
test_GetDlgItemText
();
test_DialogBoxParamA
();
test_DisabledDialogTest
();
test_MessageBoxFontTest
();
}
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