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
85aa34ee
Commit
85aa34ee
authored
Nov 04, 2013
by
Saulius Krasuckas
Committed by
Alexandre Julliard
Nov 08, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Make propsheet.c compile with -D__WINESRC__.
parent
f44ceec0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
40 deletions
+45
-40
propsheet.c
dlls/comctl32/tests/propsheet.c
+45
-40
No files found.
dlls/comctl32/tests/propsheet.c
View file @
85aa34ee
...
@@ -45,7 +45,7 @@ static void flush_events(void)
...
@@ -45,7 +45,7 @@ static void flush_events(void)
while
(
diff
>
0
)
while
(
diff
>
0
)
{
{
if
(
MsgWaitForMultipleObjects
(
0
,
NULL
,
FALSE
,
min_timeout
,
QS_ALLINPUT
)
==
WAIT_TIMEOUT
)
break
;
if
(
MsgWaitForMultipleObjects
(
0
,
NULL
,
FALSE
,
min_timeout
,
QS_ALLINPUT
)
==
WAIT_TIMEOUT
)
break
;
while
(
PeekMessage
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessage
(
&
msg
);
while
(
PeekMessage
A
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
DispatchMessageA
(
&
msg
);
diff
=
time
-
GetTickCount
();
diff
=
time
-
GetTickCount
();
}
}
}
}
...
@@ -132,7 +132,7 @@ static void test_title(void)
...
@@ -132,7 +132,7 @@ static void test_title(void)
hdlg
=
(
HWND
)
PropertySheetA
(
&
psh
);
hdlg
=
(
HWND
)
PropertySheetA
(
&
psh
);
ok
(
hdlg
!=
INVALID_HANDLE_VALUE
,
"got invalid handle value %p
\n
"
,
hdlg
);
ok
(
hdlg
!=
INVALID_HANDLE_VALUE
,
"got invalid handle value %p
\n
"
,
hdlg
);
style
=
GetWindowLong
(
hdlg
,
GWL_STYLE
);
style
=
GetWindowLong
A
(
hdlg
,
GWL_STYLE
);
ok
(
style
==
(
WS_POPUP
|
WS_VISIBLE
|
WS_CLIPSIBLINGS
|
WS_CAPTION
|
WS_SYSMENU
|
ok
(
style
==
(
WS_POPUP
|
WS_VISIBLE
|
WS_CLIPSIBLINGS
|
WS_CAPTION
|
WS_SYSMENU
|
DS_CONTEXTHELP
|
DS_MODALFRAME
|
DS_SETFONT
|
DS_3DLOOK
),
DS_CONTEXTHELP
|
DS_MODALFRAME
|
DS_SETFONT
|
DS_3DLOOK
),
"got unexpected style: %x
\n
"
,
style
);
"got unexpected style: %x
\n
"
,
style
);
...
@@ -172,14 +172,17 @@ static void test_nopage(void)
...
@@ -172,14 +172,17 @@ static void test_nopage(void)
ok
(
hdlg
!=
INVALID_HANDLE_VALUE
,
"got invalid handle value %p
\n
"
,
hdlg
);
ok
(
hdlg
!=
INVALID_HANDLE_VALUE
,
"got invalid handle value %p
\n
"
,
hdlg
);
ShowWindow
(
hdlg
,
SW_NORMAL
);
ShowWindow
(
hdlg
,
SW_NORMAL
);
SendMessage
(
hdlg
,
PSM_REMOVEPAGE
,
0
,
0
);
SendMessageA
(
hdlg
,
PSM_REMOVEPAGE
,
0
,
0
);
hpage
=
PropSheet_GetCurrentPageHwnd
(
hdlg
);
hpage
=
/* PropSheet_GetCurrentPageHwnd(hdlg); */
ok
(
hpage
==
NULL
,
"expected no current page, got %p, index=%d
\n
"
,
hpage
,
PropSheet_HwndToIndex
(
hdlg
,
hpage
));
(
HWND
)
SendMessageA
(
hdlg
,
PSM_GETCURRENTPAGEHWND
,
0
,
0
);
active_page
=
/* PropSheet_HwndToIndex(hdlg, hpage)); */
(
int
)
SendMessageA
(
hdlg
,
PSM_HWNDTOINDEX
,
(
WPARAM
)
hpage
,
0
);
ok
(
hpage
==
NULL
,
"expected no current page, got %p, index=%d
\n
"
,
hpage
,
active_page
);
flush_events
();
flush_events
();
RedrawWindow
(
hdlg
,
NULL
,
NULL
,
RDW_UPDATENOW
|
RDW_ERASENOW
);
RedrawWindow
(
hdlg
,
NULL
,
NULL
,
RDW_UPDATENOW
|
RDW_ERASENOW
);
/* Check that the property sheet was fully redrawn */
/* Check that the property sheet was fully redrawn */
ok
(
!
PeekMessage
(
&
msg
,
0
,
WM_PAINT
,
WM_PAINT
,
PM_NOREMOVE
),
ok
(
!
PeekMessage
A
(
&
msg
,
0
,
WM_PAINT
,
WM_PAINT
,
PM_NOREMOVE
),
"expected no pending WM_PAINT messages
\n
"
);
"expected no pending WM_PAINT messages
\n
"
);
DestroyWindow
(
hdlg
);
DestroyWindow
(
hdlg
);
}
}
...
@@ -208,7 +211,7 @@ static void register_parent_wnd_class(void)
...
@@ -208,7 +211,7 @@ static void register_parent_wnd_class(void)
cls
.
cbWndExtra
=
0
;
cls
.
cbWndExtra
=
0
;
cls
.
hInstance
=
GetModuleHandleA
(
NULL
);
cls
.
hInstance
=
GetModuleHandleA
(
NULL
);
cls
.
hIcon
=
0
;
cls
.
hIcon
=
0
;
cls
.
hCursor
=
LoadCursorA
(
0
,
IDC_ARROW
);
cls
.
hCursor
=
LoadCursorA
(
0
,
(
LPCSTR
)
IDC_ARROW
);
cls
.
hbrBackground
=
GetStockObject
(
WHITE_BRUSH
);
cls
.
hbrBackground
=
GetStockObject
(
WHITE_BRUSH
);
cls
.
lpszMenuName
=
NULL
;
cls
.
lpszMenuName
=
NULL
;
cls
.
lpszClassName
=
"parent class"
;
cls
.
lpszClassName
=
"parent class"
;
...
@@ -260,12 +263,13 @@ static INT_PTR CALLBACK nav_page_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
...
@@ -260,12 +263,13 @@ static INT_PTR CALLBACK nav_page_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
LPNMHDR
hdr
=
(
LPNMHDR
)
lparam
;
LPNMHDR
hdr
=
(
LPNMHDR
)
lparam
;
switch
(
hdr
->
code
){
switch
(
hdr
->
code
){
case
PSN_SETACTIVE
:
case
PSN_SETACTIVE
:
active_page
=
PropSheet_HwndToIndex
(
hdr
->
hwndFrom
,
hwnd
);
active_page
=
/* PropSheet_HwndToIndex(hdr->hwndFrom, hwnd); */
(
int
)
SendMessageA
(
hdr
->
hwndFrom
,
PSM_HWNDTOINDEX
,
(
WPARAM
)
hwnd
,
0
);
return
TRUE
;
return
TRUE
;
case
PSN_KILLACTIVE
:
case
PSN_KILLACTIVE
:
/* prevent navigation away from the fourth page */
/* prevent navigation away from the fourth page */
if
(
active_page
==
3
){
if
(
active_page
==
3
){
SetWindowLongPtr
(
hwnd
,
DWLP_MSGRESULT
,
TRUE
);
SetWindowLongPtr
A
(
hwnd
,
DWLP_MSGRESULT
,
TRUE
);
return
TRUE
;
return
TRUE
;
}
}
}
}
...
@@ -293,25 +297,25 @@ static void test_wiznavigation(void)
...
@@ -293,25 +297,25 @@ static void test_wiznavigation(void)
psp
[
0
].
dwSize
=
sizeof
(
PROPSHEETPAGEA
);
psp
[
0
].
dwSize
=
sizeof
(
PROPSHEETPAGEA
);
psp
[
0
].
hInstance
=
GetModuleHandleA
(
NULL
);
psp
[
0
].
hInstance
=
GetModuleHandleA
(
NULL
);
U
(
psp
[
0
]).
pszTemplate
=
MAKEINTRESOURCE
(
IDD_PROP_PAGE_INTRO
);
U
(
psp
[
0
]).
pszTemplate
=
(
LPCSTR
)
MAKEINTRESOURCE
(
IDD_PROP_PAGE_INTRO
);
psp
[
0
].
pfnDlgProc
=
nav_page_proc
;
psp
[
0
].
pfnDlgProc
=
nav_page_proc
;
hpsp
[
0
]
=
CreatePropertySheetPageA
(
&
psp
[
0
]);
hpsp
[
0
]
=
CreatePropertySheetPageA
(
&
psp
[
0
]);
psp
[
1
].
dwSize
=
sizeof
(
PROPSHEETPAGEA
);
psp
[
1
].
dwSize
=
sizeof
(
PROPSHEETPAGEA
);
psp
[
1
].
hInstance
=
GetModuleHandleA
(
NULL
);
psp
[
1
].
hInstance
=
GetModuleHandleA
(
NULL
);
U
(
psp
[
1
]).
pszTemplate
=
MAKEINTRESOURCE
(
IDD_PROP_PAGE_EDIT
);
U
(
psp
[
1
]).
pszTemplate
=
(
LPCSTR
)
MAKEINTRESOURCE
(
IDD_PROP_PAGE_EDIT
);
psp
[
1
].
pfnDlgProc
=
nav_page_proc
;
psp
[
1
].
pfnDlgProc
=
nav_page_proc
;
hpsp
[
1
]
=
CreatePropertySheetPageA
(
&
psp
[
1
]);
hpsp
[
1
]
=
CreatePropertySheetPageA
(
&
psp
[
1
]);
psp
[
2
].
dwSize
=
sizeof
(
PROPSHEETPAGEA
);
psp
[
2
].
dwSize
=
sizeof
(
PROPSHEETPAGEA
);
psp
[
2
].
hInstance
=
GetModuleHandleA
(
NULL
);
psp
[
2
].
hInstance
=
GetModuleHandleA
(
NULL
);
U
(
psp
[
2
]).
pszTemplate
=
MAKEINTRESOURCE
(
IDD_PROP_PAGE_RADIO
);
U
(
psp
[
2
]).
pszTemplate
=
(
LPCSTR
)
MAKEINTRESOURCE
(
IDD_PROP_PAGE_RADIO
);
psp
[
2
].
pfnDlgProc
=
nav_page_proc
;
psp
[
2
].
pfnDlgProc
=
nav_page_proc
;
hpsp
[
2
]
=
CreatePropertySheetPageA
(
&
psp
[
2
]);
hpsp
[
2
]
=
CreatePropertySheetPageA
(
&
psp
[
2
]);
psp
[
3
].
dwSize
=
sizeof
(
PROPSHEETPAGEA
);
psp
[
3
].
dwSize
=
sizeof
(
PROPSHEETPAGEA
);
psp
[
3
].
hInstance
=
GetModuleHandleA
(
NULL
);
psp
[
3
].
hInstance
=
GetModuleHandleA
(
NULL
);
U
(
psp
[
3
]).
pszTemplate
=
MAKEINTRESOURCE
(
IDD_PROP_PAGE_EXIT
);
U
(
psp
[
3
]).
pszTemplate
=
(
LPCSTR
)
MAKEINTRESOURCE
(
IDD_PROP_PAGE_EXIT
);
psp
[
3
].
pfnDlgProc
=
nav_page_proc
;
psp
[
3
].
pfnDlgProc
=
nav_page_proc
;
hpsp
[
3
]
=
CreatePropertySheetPageA
(
&
psp
[
3
]);
hpsp
[
3
]
=
CreatePropertySheetPageA
(
&
psp
[
3
]);
...
@@ -328,71 +332,71 @@ static void test_wiznavigation(void)
...
@@ -328,71 +332,71 @@ static void test_wiznavigation(void)
ok
(
active_page
==
0
,
"Active page should be 0. Is: %d
\n
"
,
active_page
);
ok
(
active_page
==
0
,
"Active page should be 0. Is: %d
\n
"
,
active_page
);
style
=
GetWindowLong
(
hdlg
,
GWL_STYLE
)
&
~
(
DS_CONTEXTHELP
|
WS_SYSMENU
);
style
=
GetWindowLong
A
(
hdlg
,
GWL_STYLE
)
&
~
(
DS_CONTEXTHELP
|
WS_SYSMENU
);
ok
(
style
==
(
WS_POPUP
|
WS_VISIBLE
|
WS_CLIPSIBLINGS
|
WS_CAPTION
|
ok
(
style
==
(
WS_POPUP
|
WS_VISIBLE
|
WS_CLIPSIBLINGS
|
WS_CAPTION
|
DS_MODALFRAME
|
DS_SETFONT
|
DS_3DLOOK
),
DS_MODALFRAME
|
DS_SETFONT
|
DS_3DLOOK
),
"got unexpected style: %x
\n
"
,
style
);
"got unexpected style: %x
\n
"
,
style
);
control
=
GetFocus
();
control
=
GetFocus
();
controlID
=
GetWindowLongPtr
(
control
,
GWLP_ID
);
controlID
=
GetWindowLongPtr
A
(
control
,
GWLP_ID
);
ok
(
controlID
==
nextID
,
"Focus should have been set to the Next button. Expected: %d, Found: %ld
\n
"
,
nextID
,
controlID
);
ok
(
controlID
==
nextID
,
"Focus should have been set to the Next button. Expected: %d, Found: %ld
\n
"
,
nextID
,
controlID
);
/* simulate pressing the Next button */
/* simulate pressing the Next button */
SendMessage
(
hdlg
,
PSM_PRESSBUTTON
,
PSBTN_NEXT
,
0
);
SendMessage
A
(
hdlg
,
PSM_PRESSBUTTON
,
PSBTN_NEXT
,
0
);
if
(
!
active_page
)
hwndtoindex_supported
=
FALSE
;
if
(
!
active_page
)
hwndtoindex_supported
=
FALSE
;
if
(
hwndtoindex_supported
)
if
(
hwndtoindex_supported
)
ok
(
active_page
==
1
,
"Active page should be 1 after pressing Next. Is: %d
\n
"
,
active_page
);
ok
(
active_page
==
1
,
"Active page should be 1 after pressing Next. Is: %d
\n
"
,
active_page
);
control
=
GetFocus
();
control
=
GetFocus
();
controlID
=
GetWindowLongPtr
(
control
,
GWLP_ID
);
controlID
=
GetWindowLongPtr
A
(
control
,
GWLP_ID
);
ok
(
controlID
==
IDC_PS_EDIT1
,
"Focus should be set to the first item on the second page. Expected: %d, Found: %ld
\n
"
,
IDC_PS_EDIT1
,
controlID
);
ok
(
controlID
==
IDC_PS_EDIT1
,
"Focus should be set to the first item on the second page. Expected: %d, Found: %ld
\n
"
,
IDC_PS_EDIT1
,
controlID
);
defidres
=
SendMessage
(
hdlg
,
DM_GETDEFID
,
0
,
0
);
defidres
=
SendMessage
A
(
hdlg
,
DM_GETDEFID
,
0
,
0
);
ok
(
defidres
==
MAKELRESULT
(
nextID
,
DC_HASDEFID
),
"Expected default button ID to be %d, is %d
\n
"
,
nextID
,
LOWORD
(
defidres
));
ok
(
defidres
==
MAKELRESULT
(
nextID
,
DC_HASDEFID
),
"Expected default button ID to be %d, is %d
\n
"
,
nextID
,
LOWORD
(
defidres
));
/* set the focus to the second edit box on this page */
/* set the focus to the second edit box on this page */
SetFocus
(
GetNextDlgTabItem
(
hdlg
,
control
,
FALSE
));
SetFocus
(
GetNextDlgTabItem
(
hdlg
,
control
,
FALSE
));
/* press next again */
/* press next again */
SendMessage
(
hdlg
,
PSM_PRESSBUTTON
,
PSBTN_NEXT
,
0
);
SendMessage
A
(
hdlg
,
PSM_PRESSBUTTON
,
PSBTN_NEXT
,
0
);
if
(
hwndtoindex_supported
)
if
(
hwndtoindex_supported
)
ok
(
active_page
==
2
,
"Active page should be 2 after pressing Next. Is: %d
\n
"
,
active_page
);
ok
(
active_page
==
2
,
"Active page should be 2 after pressing Next. Is: %d
\n
"
,
active_page
);
control
=
GetFocus
();
control
=
GetFocus
();
controlID
=
GetWindowLongPtr
(
control
,
GWLP_ID
);
controlID
=
GetWindowLongPtr
A
(
control
,
GWLP_ID
);
ok
(
controlID
==
IDC_PS_RADIO1
,
"Focus should have been set to item on third page. Expected: %d, Found %ld
\n
"
,
IDC_PS_RADIO1
,
controlID
);
ok
(
controlID
==
IDC_PS_RADIO1
,
"Focus should have been set to item on third page. Expected: %d, Found %ld
\n
"
,
IDC_PS_RADIO1
,
controlID
);
/* back button */
/* back button */
SendMessage
(
hdlg
,
PSM_PRESSBUTTON
,
PSBTN_BACK
,
0
);
SendMessage
A
(
hdlg
,
PSM_PRESSBUTTON
,
PSBTN_BACK
,
0
);
if
(
hwndtoindex_supported
)
if
(
hwndtoindex_supported
)
ok
(
active_page
==
1
,
"Active page should be 1 after pressing Back. Is: %d
\n
"
,
active_page
);
ok
(
active_page
==
1
,
"Active page should be 1 after pressing Back. Is: %d
\n
"
,
active_page
);
control
=
GetFocus
();
control
=
GetFocus
();
controlID
=
GetWindowLongPtr
(
control
,
GWLP_ID
);
controlID
=
GetWindowLongPtr
A
(
control
,
GWLP_ID
);
ok
(
controlID
==
IDC_PS_EDIT1
,
"Focus should have been set to the first item on second page. Expected: %d, Found %ld
\n
"
,
IDC_PS_EDIT1
,
controlID
);
ok
(
controlID
==
IDC_PS_EDIT1
,
"Focus should have been set to the first item on second page. Expected: %d, Found %ld
\n
"
,
IDC_PS_EDIT1
,
controlID
);
defidres
=
SendMessage
(
hdlg
,
DM_GETDEFID
,
0
,
0
);
defidres
=
SendMessage
A
(
hdlg
,
DM_GETDEFID
,
0
,
0
);
ok
(
defidres
==
MAKELRESULT
(
backID
,
DC_HASDEFID
),
"Expected default button ID to be %d, is %d
\n
"
,
backID
,
LOWORD
(
defidres
));
ok
(
defidres
==
MAKELRESULT
(
backID
,
DC_HASDEFID
),
"Expected default button ID to be %d, is %d
\n
"
,
backID
,
LOWORD
(
defidres
));
/* press next twice */
/* press next twice */
SendMessage
(
hdlg
,
PSM_PRESSBUTTON
,
PSBTN_NEXT
,
0
);
SendMessage
A
(
hdlg
,
PSM_PRESSBUTTON
,
PSBTN_NEXT
,
0
);
if
(
hwndtoindex_supported
)
if
(
hwndtoindex_supported
)
ok
(
active_page
==
2
,
"Active page should be 2 after pressing Next. Is: %d
\n
"
,
active_page
);
ok
(
active_page
==
2
,
"Active page should be 2 after pressing Next. Is: %d
\n
"
,
active_page
);
SendMessage
(
hdlg
,
PSM_PRESSBUTTON
,
PSBTN_NEXT
,
0
);
SendMessage
A
(
hdlg
,
PSM_PRESSBUTTON
,
PSBTN_NEXT
,
0
);
if
(
hwndtoindex_supported
)
if
(
hwndtoindex_supported
)
ok
(
active_page
==
3
,
"Active page should be 3 after pressing Next. Is: %d
\n
"
,
active_page
);
ok
(
active_page
==
3
,
"Active page should be 3 after pressing Next. Is: %d
\n
"
,
active_page
);
else
else
active_page
=
3
;
active_page
=
3
;
control
=
GetFocus
();
control
=
GetFocus
();
controlID
=
GetWindowLongPtr
(
control
,
GWLP_ID
);
controlID
=
GetWindowLongPtr
A
(
control
,
GWLP_ID
);
ok
(
controlID
==
nextID
,
"Focus should have been set to the Next button. Expected: %d, Found: %ld
\n
"
,
nextID
,
controlID
);
ok
(
controlID
==
nextID
,
"Focus should have been set to the Next button. Expected: %d, Found: %ld
\n
"
,
nextID
,
controlID
);
/* try to navigate away, but shouldn't be able to */
/* try to navigate away, but shouldn't be able to */
SendMessage
(
hdlg
,
PSM_PRESSBUTTON
,
PSBTN_BACK
,
0
);
SendMessage
A
(
hdlg
,
PSM_PRESSBUTTON
,
PSBTN_BACK
,
0
);
ok
(
active_page
==
3
,
"Active page should still be 3 after pressing Back. Is: %d
\n
"
,
active_page
);
ok
(
active_page
==
3
,
"Active page should still be 3 after pressing Back. Is: %d
\n
"
,
active_page
);
defidres
=
SendMessage
(
hdlg
,
DM_GETDEFID
,
0
,
0
);
defidres
=
SendMessage
A
(
hdlg
,
DM_GETDEFID
,
0
,
0
);
ok
(
defidres
==
MAKELRESULT
(
nextID
,
DC_HASDEFID
),
"Expected default button ID to be %d, is %d
\n
"
,
nextID
,
LOWORD
(
defidres
));
ok
(
defidres
==
MAKELRESULT
(
nextID
,
DC_HASDEFID
),
"Expected default button ID to be %d, is %d
\n
"
,
nextID
,
LOWORD
(
defidres
));
DestroyWindow
(
hdlg
);
DestroyWindow
(
hdlg
);
...
@@ -493,7 +497,7 @@ static void test_custom_default_button(void)
...
@@ -493,7 +497,7 @@ static void test_custom_default_button(void)
psp
[
0
].
dwSize
=
sizeof
(
PROPSHEETPAGEA
);
psp
[
0
].
dwSize
=
sizeof
(
PROPSHEETPAGEA
);
psp
[
0
].
dwFlags
=
PSP_USETITLE
;
psp
[
0
].
dwFlags
=
PSP_USETITLE
;
psp
[
0
].
hInstance
=
GetModuleHandleA
(
NULL
);
psp
[
0
].
hInstance
=
GetModuleHandleA
(
NULL
);
U
(
psp
[
0
]).
pszTemplate
=
MAKEINTRESOURCE
(
IDD_PROP_PAGE_WITH_CUSTOM_DEFAULT_BUTTON
);
U
(
psp
[
0
]).
pszTemplate
=
(
LPCSTR
)
MAKEINTRESOURCE
(
IDD_PROP_PAGE_WITH_CUSTOM_DEFAULT_BUTTON
);
U2
(
psp
[
0
]).
pszIcon
=
NULL
;
U2
(
psp
[
0
]).
pszIcon
=
NULL
;
psp
[
0
].
pfnDlgProc
=
page_with_custom_default_button_dlg_proc
;
psp
[
0
].
pfnDlgProc
=
page_with_custom_default_button_dlg_proc
;
psp
[
0
].
pszTitle
=
"Page1"
;
psp
[
0
].
pszTitle
=
"Page1"
;
...
@@ -519,10 +523,10 @@ static void test_custom_default_button(void)
...
@@ -519,10 +523,10 @@ static void test_custom_default_button(void)
ok
(
hdlg
!=
INVALID_HANDLE_VALUE
,
"Cannot create the property sheet
\n
"
);
ok
(
hdlg
!=
INVALID_HANDLE_VALUE
,
"Cannot create the property sheet
\n
"
);
/* Set the Add button as the default button. */
/* Set the Add button as the default button. */
SendMessage
(
hdlg
,
DM_SETDEFID
,
(
WPARAM
)
IDC_PS_PUSHBUTTON1
,
0
);
SendMessage
A
(
hdlg
,
DM_SETDEFID
,
(
WPARAM
)
IDC_PS_PUSHBUTTON1
,
0
);
/* Make sure the default button is the Add button. */
/* Make sure the default button is the Add button. */
result
=
SendMessage
(
hdlg
,
DM_GETDEFID
,
0
,
0
);
result
=
SendMessage
A
(
hdlg
,
DM_GETDEFID
,
0
,
0
);
ok
(
DC_HASDEFID
==
HIWORD
(
result
),
"The property sheet does not have a default button
\n
"
);
ok
(
DC_HASDEFID
==
HIWORD
(
result
),
"The property sheet does not have a default button
\n
"
);
ok
(
IDC_PS_PUSHBUTTON1
==
LOWORD
(
result
),
"The default button is not the Add button
\n
"
);
ok
(
IDC_PS_PUSHBUTTON1
==
LOWORD
(
result
),
"The default button is not the Add button
\n
"
);
...
@@ -531,12 +535,13 @@ static void test_custom_default_button(void)
...
@@ -531,12 +535,13 @@ static void test_custom_default_button(void)
keybd_event
(
VK_RETURN
,
0
,
0
,
0
);
keybd_event
(
VK_RETURN
,
0
,
0
,
0
);
/* Process all the messages in the queue for this thread. */
/* Process all the messages in the queue for this thread. */
while
(
PeekMessage
(
&
msg
,
NULL
,
0
,
0
,
PM_REMOVE
))
while
(
PeekMessage
A
(
&
msg
,
NULL
,
0
,
0
,
PM_REMOVE
))
{
{
if
(
!
PropSheet_IsDialogMessage
(
hdlg
,
&
msg
))
/* (!PropSheet_IsDialogMessage(hdlg, &msg)) */
if
(
!
((
BOOL
)
SendMessageA
(
hdlg
,
PSM_ISDIALOGMESSAGE
,
0
,
(
LPARAM
)
&
msg
)))
{
{
TranslateMessage
(
&
msg
);
TranslateMessage
(
&
msg
);
DispatchMessage
(
&
msg
);
DispatchMessage
A
(
&
msg
);
}
}
}
}
...
@@ -680,7 +685,7 @@ static LRESULT CALLBACK sheet_callback_messages_proc (HWND hwnd, UINT msg, WPARA
...
@@ -680,7 +685,7 @@ static LRESULT CALLBACK sheet_callback_messages_proc (HWND hwnd, UINT msg, WPARA
{
{
save_message
(
hwnd
,
msg
,
wParam
,
lParam
,
RECEIVER_SHEET_WINPROC
);
save_message
(
hwnd
,
msg
,
wParam
,
lParam
,
RECEIVER_SHEET_WINPROC
);
return
CallWindowProc
(
oldWndProc
,
hwnd
,
msg
,
wParam
,
lParam
);
return
CallWindowProc
A
(
oldWndProc
,
hwnd
,
msg
,
wParam
,
lParam
);
}
}
static
int
CALLBACK
sheet_callback_messages
(
HWND
hwnd
,
UINT
msg
,
LPARAM
lParam
)
static
int
CALLBACK
sheet_callback_messages
(
HWND
hwnd
,
UINT
msg
,
LPARAM
lParam
)
...
@@ -690,8 +695,8 @@ static int CALLBACK sheet_callback_messages(HWND hwnd, UINT msg, LPARAM lParam)
...
@@ -690,8 +695,8 @@ static int CALLBACK sheet_callback_messages(HWND hwnd, UINT msg, LPARAM lParam)
switch
(
msg
)
switch
(
msg
)
{
{
case
PSCB_INITIALIZED
:
case
PSCB_INITIALIZED
:
oldWndProc
=
(
WNDPROC
)
GetWindowLongPtr
(
hwnd
,
GWLP_WNDPROC
);
oldWndProc
=
(
WNDPROC
)
GetWindowLongPtr
A
(
hwnd
,
GWLP_WNDPROC
);
SetWindowLongPtr
(
hwnd
,
GWLP_WNDPROC
,
(
LONG_PTR
)
&
sheet_callback_messages_proc
);
SetWindowLongPtr
A
(
hwnd
,
GWLP_WNDPROC
,
(
LONG_PTR
)
&
sheet_callback_messages_proc
);
return
TRUE
;
return
TRUE
;
}
}
...
@@ -719,7 +724,7 @@ static void test_messages(void)
...
@@ -719,7 +724,7 @@ static void test_messages(void)
psp
.
dwSize
=
sizeof
(
psp
);
psp
.
dwSize
=
sizeof
(
psp
);
psp
.
dwFlags
=
0
;
psp
.
dwFlags
=
0
;
psp
.
hInstance
=
GetModuleHandleA
(
NULL
);
psp
.
hInstance
=
GetModuleHandleA
(
NULL
);
U
(
psp
).
pszTemplate
=
MAKEINTRESOURCE
(
IDD_PROP_PAGE_MESSAGE_TEST
);
U
(
psp
).
pszTemplate
=
(
LPCSTR
)
MAKEINTRESOURCE
(
IDD_PROP_PAGE_MESSAGE_TEST
);
U2
(
psp
).
pszIcon
=
NULL
;
U2
(
psp
).
pszIcon
=
NULL
;
psp
.
pfnDlgProc
=
page_dlg_proc_messages
;
psp
.
pfnDlgProc
=
page_dlg_proc_messages
;
psp
.
lParam
=
0
;
psp
.
lParam
=
0
;
...
@@ -759,7 +764,7 @@ static void test_PSM_ADDPAGE(void)
...
@@ -759,7 +764,7 @@ static void test_PSM_ADDPAGE(void)
psp
.
dwSize
=
sizeof
(
psp
);
psp
.
dwSize
=
sizeof
(
psp
);
psp
.
dwFlags
=
0
;
psp
.
dwFlags
=
0
;
psp
.
hInstance
=
GetModuleHandleA
(
NULL
);
psp
.
hInstance
=
GetModuleHandleA
(
NULL
);
U
(
psp
).
pszTemplate
=
MAKEINTRESOURCE
(
IDD_PROP_PAGE_MESSAGE_TEST
);
U
(
psp
).
pszTemplate
=
(
LPCSTR
)
MAKEINTRESOURCE
(
IDD_PROP_PAGE_MESSAGE_TEST
);
U2
(
psp
).
pszIcon
=
NULL
;
U2
(
psp
).
pszIcon
=
NULL
;
psp
.
pfnDlgProc
=
page_dlg_proc_messages
;
psp
.
pfnDlgProc
=
page_dlg_proc_messages
;
psp
.
lParam
=
0
;
psp
.
lParam
=
0
;
...
@@ -769,7 +774,7 @@ static void test_PSM_ADDPAGE(void)
...
@@ -769,7 +774,7 @@ static void test_PSM_ADDPAGE(void)
hpsp
[
1
]
=
CreatePropertySheetPageA
(
&
psp
);
hpsp
[
1
]
=
CreatePropertySheetPageA
(
&
psp
);
hpsp
[
2
]
=
CreatePropertySheetPageA
(
&
psp
);
hpsp
[
2
]
=
CreatePropertySheetPageA
(
&
psp
);
U
(
psp
).
pszTemplate
=
MAKEINTRESOURCE
(
IDD_PROP_PAGE_ERROR
);
U
(
psp
).
pszTemplate
=
(
LPCSTR
)
MAKEINTRESOURCE
(
IDD_PROP_PAGE_ERROR
);
hpsp
[
3
]
=
CreatePropertySheetPageA
(
&
psp
);
hpsp
[
3
]
=
CreatePropertySheetPageA
(
&
psp
);
psp
.
dwFlags
=
PSP_PREMATURE
;
psp
.
dwFlags
=
PSP_PREMATURE
;
...
...
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