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
7c2263dd
Commit
7c2263dd
authored
Oct 25, 2007
by
Lei Zhang
Committed by
Alexandre Julliard
Oct 25, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Do not send button click to dialog with disabled default button.
parent
03f5774d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
0 deletions
+49
-0
dialog.c
dlls/user32/dialog.c
+3
-0
dialog.c
dlls/user32/tests/dialog.c
+46
-0
No files found.
dlls/user32/dialog.c
View file @
7c2263dd
...
...
@@ -1183,6 +1183,9 @@ BOOL WINAPI IsDialogMessageW( HWND hwndDlg, LPMSG msg )
}
else
if
(
DC_HASDEFID
==
HIWORD
(
dw
=
SendMessageW
(
hwndDlg
,
DM_GETDEFID
,
0
,
0
)))
{
HWND
hwndDef
=
GetDlgItem
(
hwndDlg
,
LOWORD
(
dw
));
if
(
!
hwndDef
||
!
IsWindowEnabled
(
hwndDef
))
return
TRUE
;
SendMessageW
(
hwndDlg
,
WM_COMMAND
,
MAKEWPARAM
(
LOWORD
(
dw
),
BN_CLICKED
),
(
LPARAM
)
GetDlgItem
(
hwndDlg
,
LOWORD
(
dw
)));
}
...
...
dlls/user32/tests/dialog.c
View file @
7c2263dd
...
...
@@ -488,6 +488,44 @@ static LRESULT CALLBACK main_window_procA (HWND hwnd, UINT uiMsg, WPARAM wParam,
return
result
;
}
static
LRESULT
CALLBACK
disabled_test_proc
(
HWND
hwnd
,
UINT
uiMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
LRESULT
result
;
DWORD
dw
;
HWND
hwndOk
;
switch
(
uiMsg
)
{
case
WM_INITDIALOG
:
dw
=
SendMessage
(
hwnd
,
DM_GETDEFID
,
0
,
0
);
assert
(
DC_HASDEFID
==
HIWORD
(
dw
));
hwndOk
=
GetDlgItem
(
hwnd
,
LOWORD
(
dw
));
assert
(
hwndOk
);
EnableWindow
(
hwndOk
,
FALSE
);
PostMessage
(
hwnd
,
WM_KEYDOWN
,
VK_RETURN
,
0
);
PostMessage
(
hwnd
,
WM_COMMAND
,
IDCANCEL
,
0
);
break
;
case
WM_COMMAND
:
if
(
wParam
==
IDOK
)
{
g_terminated
=
TRUE
;
EndDialog
(
hwnd
,
0
);
return
0
;
}
else
if
(
wParam
==
IDCANCEL
)
{
EndDialog
(
hwnd
,
0
);
return
0
;
}
break
;
}
result
=
DefWindowProcA
(
hwnd
,
uiMsg
,
wParam
,
lParam
);
return
result
;
}
static
LRESULT
CALLBACK
testDlgWinProc
(
HWND
hwnd
,
UINT
uiMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
...
...
@@ -876,6 +914,13 @@ static void test_DialogBoxParamA(void)
ok
(
ERROR_RESOURCE_NAME_NOT_FOUND
==
GetLastError
(),
"got %d, expected ERROR_RESOURCE_NAME_NOT_FOUND
\n
"
,
GetLastError
());
}
static
void
test_DisabledDialogTest
(
void
)
{
g_terminated
=
FALSE
;
DialogBoxParam
(
g_hinst
,
"IDD_DIALOG"
,
NULL
,
(
DLGPROC
)
disabled_test_proc
,
0
);
ok
(
FALSE
==
g_terminated
,
"dialog with disabled ok button has been terminated
\n
"
);
}
START_TEST
(
dialog
)
{
g_hinst
=
GetModuleHandleA
(
0
);
...
...
@@ -888,4 +933,5 @@ START_TEST(dialog)
InitialFocusTest
();
test_GetDlgItemText
();
test_DialogBoxParamA
();
test_DisabledDialogTest
();
}
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