user32: Use IDOK as default identifier in a template.

This commit is contained in:
Sergey Khodych 2009-08-25 17:19:24 +03:00 committed by Alexandre Julliard
parent 205a7f7f03
commit f1f1c50531
3 changed files with 24 additions and 1 deletions

View File

@ -674,7 +674,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
dlgInfo->hMenu = hMenu;
dlgInfo->xBaseUnit = xBaseUnit;
dlgInfo->yBaseUnit = yBaseUnit;
dlgInfo->idResult = 0;
dlgInfo->idResult = IDOK;
dlgInfo->flags = flags;
dlgInfo->hDialogHeap = 0;

View File

@ -930,6 +930,19 @@ static INT_PTR CALLBACK DestroyOnCloseDlgWinProc (HWND hDlg, UINT uiMsg,
return FALSE;
}
static INT_PTR CALLBACK TestDefButtonDlgProc (HWND hDlg, UINT uiMsg,
WPARAM wParam, LPARAM lParam)
{
switch (uiMsg)
{
case WM_INITDIALOG:
EndDialog(hDlg, LOWORD(SendMessage(hDlg, DM_GETDEFID, 0, 0)));
return TRUE;
}
return FALSE;
}
static void test_DialogBoxParamA(void)
{
INT_PTR ret;
@ -968,6 +981,9 @@ static void test_DialogBoxParamA(void)
ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE ||
broken(GetLastError() == 0xdeadbeef),
"got %d, expected ERROR_INVALID_WINDOW_HANDLE\n", GetLastError());
ret = DialogBoxParamA(GetModuleHandle(NULL), "TEST_EMPTY_DIALOG", 0, TestDefButtonDlgProc, 0);
ok(ret == IDOK, "Expected IDOK\n");
}
static void test_DisabledDialogTest(void)

View File

@ -98,6 +98,13 @@ BEGIN
PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14
END
TEST_EMPTY_DIALOG DIALOG DISCARDABLE 0, 0, 186, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Sans Serif"
BEGIN
END
MULTI_EDIT_DIALOG DIALOG DISCARDABLE 0, 0, 160, 75
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | DS_CENTER
CAPTION "Multiple Edit Test"