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
0b230128
Commit
0b230128
authored
Feb 23, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Feb 23, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Ensure that WM_INITDIALOG passes the first tabstop control handle to the dialog procedure.
parent
30f6dc95
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
3 deletions
+24
-3
dialog.c
dlls/user32/dialog.c
+6
-3
dialog.c
dlls/user32/tests/dialog.c
+18
-0
No files found.
dlls/user32/dialog.c
View file @
0b230128
...
...
@@ -690,11 +690,14 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
if
(
dlgProc
)
{
if
(
SendMessageW
(
hwnd
,
WM_INITDIALOG
,
(
WPARAM
)
dlgInfo
->
hwndFocus
,
param
)
&&
HWND
focus
=
GetNextDlgTabItem
(
hwnd
,
0
,
FALSE
);
if
(
SendMessageW
(
hwnd
,
WM_INITDIALOG
,
(
WPARAM
)
focus
,
param
)
&&
((
~
template
.
style
&
DS_CONTROL
)
||
(
template
.
style
&
WS_VISIBLE
)))
{
/* By returning TRUE, app has requested a default focus assignment */
dlgInfo
->
hwndFocus
=
GetNextDlgTabItem
(
hwnd
,
0
,
FALSE
);
/* By returning TRUE, app has requested a default focus assignment.
* WM_INITDIALOG may have changed the tab order, so find the first
* tabstop control again. */
dlgInfo
->
hwndFocus
=
GetNextDlgTabItem
(
hwnd
,
0
,
FALSE
);
if
(
dlgInfo
->
hwndFocus
)
SetFocus
(
dlgInfo
->
hwndFocus
);
}
...
...
dlls/user32/tests/dialog.c
View file @
0b230128
...
...
@@ -926,6 +926,21 @@ static INT_PTR CALLBACK DestroyOnCloseDlgWinProc (HWND hDlg, UINT uiMsg,
return
FALSE
;
}
static
INT_PTR
CALLBACK
TestInitDialogHandleProc
(
HWND
hDlg
,
UINT
uiMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
if
(
uiMsg
==
WM_INITDIALOG
)
{
HWND
expected
=
GetNextDlgTabItem
(
hDlg
,
NULL
,
FALSE
);
ok
(
expected
==
(
HWND
)
wParam
,
"Expected wParam to be the handle to the first tabstop control (%p), got %p
\n
"
,
expected
,
(
HWND
)
wParam
);
EndDialog
(
hDlg
,
LOWORD
(
SendMessage
(
hDlg
,
DM_GETDEFID
,
0
,
0
)));
return
TRUE
;
}
return
FALSE
;
}
static
INT_PTR
CALLBACK
TestDefButtonDlgProc
(
HWND
hDlg
,
UINT
uiMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
...
...
@@ -978,6 +993,9 @@ static void test_DialogBoxParamA(void)
broken
(
GetLastError
()
==
0xdeadbeef
),
"got %d, expected ERROR_INVALID_WINDOW_HANDLE
\n
"
,
GetLastError
());
ret
=
DialogBoxParamA
(
GetModuleHandle
(
NULL
),
"TEST_EMPTY_DIALOG"
,
0
,
TestInitDialogHandleProc
,
0
);
ok
(
ret
==
IDOK
,
"Expected IDOK
\n
"
);
ret
=
DialogBoxParamA
(
GetModuleHandle
(
NULL
),
"TEST_EMPTY_DIALOG"
,
0
,
TestDefButtonDlgProc
,
0
);
ok
(
ret
==
IDOK
,
"Expected IDOK
\n
"
);
}
...
...
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