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
433df0d5
Commit
433df0d5
authored
Oct 28, 2014
by
Huw Davies
Committed by
Alexandre Julliard
Oct 30, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Enable the appropriate wizard buttons before sending DM_SETDEFID.
parent
04305134
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
16 deletions
+41
-16
propsheet.c
dlls/comctl32/propsheet.c
+5
-16
propsheet.c
dlls/comctl32/tests/propsheet.c
+36
-0
No files found.
dlls/comctl32/propsheet.c
View file @
433df0d5
...
...
@@ -2430,15 +2430,16 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags)
HWND
hwndBack
=
GetDlgItem
(
hwndDlg
,
IDC_BACK_BUTTON
);
HWND
hwndNext
=
GetDlgItem
(
hwndDlg
,
IDC_NEXT_BUTTON
);
HWND
hwndFinish
=
GetDlgItem
(
hwndDlg
,
IDC_FINISH_BUTTON
);
BOOL
enable_finish
=
((
dwFlags
&
PSWIZB_FINISH
)
||
psInfo
->
hasFinish
)
&&
!
(
dwFlags
&
PSWIZB_DISABLEDFINISH
);
TRACE
(
"%d
\n
"
,
dwFlags
);
EnableWindow
(
hwndBack
,
FALSE
);
EnableWindow
(
hwndNext
,
FALSE
);
EnableWindow
(
hwndFinish
,
FALSE
);
EnableWindow
(
hwndBack
,
dwFlags
&
PSWIZB_BACK
);
EnableWindow
(
hwndNext
,
dwFlags
&
PSWIZB_NEXT
);
EnableWindow
(
hwndFinish
,
enable_finish
);
/* set the default pushbutton to an enabled button */
if
(
((
dwFlags
&
PSWIZB_FINISH
)
||
psInfo
->
hasFinish
)
&&
!
(
dwFlags
&
PSWIZB_DISABLEDFINISH
)
)
if
(
enable_finish
)
SendMessageW
(
hwndDlg
,
DM_SETDEFID
,
IDC_FINISH_BUTTON
,
0
);
else
if
(
dwFlags
&
PSWIZB_NEXT
)
SendMessageW
(
hwndDlg
,
DM_SETDEFID
,
IDC_NEXT_BUTTON
,
0
);
...
...
@@ -2447,13 +2448,6 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags)
else
SendMessageW
(
hwndDlg
,
DM_SETDEFID
,
IDCANCEL
,
0
);
if
(
dwFlags
&
PSWIZB_BACK
)
EnableWindow
(
hwndBack
,
TRUE
);
if
(
dwFlags
&
PSWIZB_NEXT
)
EnableWindow
(
hwndNext
,
TRUE
);
if
(
!
psInfo
->
hasFinish
)
{
if
((
dwFlags
&
PSWIZB_FINISH
)
||
(
dwFlags
&
PSWIZB_DISABLEDFINISH
))
...
...
@@ -2463,9 +2457,6 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags)
/* Show the Finish button */
ShowWindow
(
hwndFinish
,
SW_SHOW
);
if
(
!
(
dwFlags
&
PSWIZB_DISABLEDFINISH
))
EnableWindow
(
hwndFinish
,
TRUE
);
}
else
{
...
...
@@ -2475,8 +2466,6 @@ static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags)
ShowWindow
(
hwndNext
,
SW_SHOW
);
}
}
else
if
(
!
(
dwFlags
&
PSWIZB_DISABLEDFINISH
))
EnableWindow
(
hwndFinish
,
TRUE
);
}
/******************************************************************************
...
...
dlls/comctl32/tests/propsheet.c
View file @
433df0d5
...
...
@@ -279,6 +279,37 @@ static INT_PTR CALLBACK nav_page_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM
return
FALSE
;
}
static
WNDPROC
old_nav_dialog_proc
;
static
LRESULT
CALLBACK
new_nav_dialog_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wp
,
LPARAM
lp
)
{
switch
(
msg
)
{
case
DM_SETDEFID
:
ok
(
IsWindowEnabled
(
GetDlgItem
(
hwnd
,
wp
)
),
"button is not enabled
\n
"
);
break
;
}
return
CallWindowProcW
(
old_nav_dialog_proc
,
hwnd
,
msg
,
wp
,
lp
);
}
static
LRESULT
CALLBACK
hook_proc
(
int
code
,
WPARAM
wp
,
LPARAM
lp
)
{
static
BOOL
done
;
if
(
code
==
HCBT_CREATEWND
)
{
CBT_CREATEWNDW
*
c
=
(
CBT_CREATEWNDW
*
)
lp
;
/* The first dialog created will be the parent dialog */
if
(
!
done
&&
c
->
lpcs
->
lpszClass
==
MAKEINTRESOURCEW
(
WC_DIALOG
))
{
old_nav_dialog_proc
=
(
WNDPROC
)
SetWindowLongPtrW
(
(
HWND
)
wp
,
GWLP_WNDPROC
,
(
LONG_PTR
)
new_nav_dialog_proc
);
done
=
TRUE
;
}
}
return
CallNextHookEx
(
NULL
,
code
,
wp
,
lp
);
}
static
void
test_wiznavigation
(
void
)
{
HPROPSHEETPAGE
hpsp
[
4
];
...
...
@@ -291,6 +322,10 @@ static void test_wiznavigation(void)
BOOL
hwndtoindex_supported
=
TRUE
;
const
INT
nextID
=
12324
;
const
INT
backID
=
12323
;
HHOOK
hook
;
/* set up a hook proc in order to subclass the main dialog early on */
hook
=
SetWindowsHookExW
(
WH_CBT
,
hook_proc
,
NULL
,
GetCurrentThreadId
()
);
/* create the property sheet pages */
memset
(
psp
,
0
,
sizeof
(
PROPSHEETPAGEA
)
*
4
);
...
...
@@ -400,6 +435,7 @@ static void test_wiznavigation(void)
ok
(
defidres
==
MAKELRESULT
(
nextID
,
DC_HASDEFID
),
"Expected default button ID to be %d, is %d
\n
"
,
nextID
,
LOWORD
(
defidres
));
DestroyWindow
(
hdlg
);
UnhookWindowsHookEx
(
hook
);
}
static
void
test_buttons
(
void
)
...
...
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