user32/tests: Add more dialog creation message tests.
Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
73ee2a8b4f
commit
e7aabc640d
|
@ -11901,6 +11901,47 @@ static INT_PTR WINAPI test_dlg_proc(HWND hwnd, UINT message, WPARAM wParam, LPAR
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static WNDPROC orig_edit_proc;
|
||||||
|
static LRESULT WINAPI dlg_creation_edit_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
|
||||||
|
{
|
||||||
|
struct recvd_message msg;
|
||||||
|
|
||||||
|
if (ignore_message( message )) return 0;
|
||||||
|
|
||||||
|
msg.hwnd = hwnd;
|
||||||
|
msg.message = message;
|
||||||
|
msg.flags = sent|wparam|lparam;
|
||||||
|
msg.wParam = wp;
|
||||||
|
msg.lParam = lp;
|
||||||
|
msg.descr = "edit";
|
||||||
|
add_message(&msg);
|
||||||
|
|
||||||
|
return CallWindowProcW(orig_edit_proc, hwnd, message, wp, lp);
|
||||||
|
}
|
||||||
|
|
||||||
|
static INT_PTR WINAPI test_dlg_proc2(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
struct recvd_message msg;
|
||||||
|
|
||||||
|
if (ignore_message( message )) return 0;
|
||||||
|
|
||||||
|
msg.hwnd = hwnd;
|
||||||
|
msg.message = message;
|
||||||
|
msg.flags = sent|wparam|lparam|parent;
|
||||||
|
msg.wParam = wParam;
|
||||||
|
msg.lParam = lParam;
|
||||||
|
msg.descr = "dialog";
|
||||||
|
add_message(&msg);
|
||||||
|
|
||||||
|
if (message == WM_INITDIALOG)
|
||||||
|
{
|
||||||
|
orig_edit_proc = (WNDPROC)SetWindowLongPtrW(GetDlgItem(hwnd, 200),
|
||||||
|
GWLP_WNDPROC, (LONG_PTR)dlg_creation_edit_proc);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct message WmDefDlgSetFocus_1[] = {
|
static const struct message WmDefDlgSetFocus_1[] = {
|
||||||
{ WM_GETDLGCODE, sent|wparam|lparam, 0, 0 },
|
{ WM_GETDLGCODE, sent|wparam|lparam, 0, 0 },
|
||||||
{ WM_GETTEXTLENGTH, sent|wparam|lparam|optional, 0, 0 }, /* XP */
|
{ WM_GETTEXTLENGTH, sent|wparam|lparam|optional, 0, 0 }, /* XP */
|
||||||
|
@ -11959,6 +12000,30 @@ static const struct message WmCreateDialogParamSeq_2[] = {
|
||||||
{ 0 }
|
{ 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct message WmCreateDialogParamSeq_3[] = {
|
||||||
|
{ HCBT_CREATEWND, hook },
|
||||||
|
{ WM_SETFONT, sent|parent },
|
||||||
|
{ WM_INITDIALOG, sent|parent },
|
||||||
|
{ WM_GETDLGCODE, sent|wparam|lparam, 0, 0 },
|
||||||
|
{ EM_SETSEL, sent|wparam|lparam, 0, INT_MAX },
|
||||||
|
{ EM_SETSEL, sent|wparam|lparam|optional, 0, INT_MAX },
|
||||||
|
{ EM_SETSEL, sent|wparam|lparam|optional, 0, INT_MAX },
|
||||||
|
{ EM_SETSEL, sent|wparam|lparam|optional, 0, INT_MAX },
|
||||||
|
{ HCBT_ACTIVATE, hook },
|
||||||
|
{ WM_QUERYNEWPALETTE, sent|parent|optional }, /* TODO: this message should not be sent */
|
||||||
|
{ WM_WINDOWPOSCHANGING, sent|parent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE },
|
||||||
|
{ WM_WINDOWPOSCHANGING, sent|parent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE },
|
||||||
|
{ WM_ACTIVATEAPP, sent|parent|wparam, 1 },
|
||||||
|
{ WM_NCACTIVATE, sent|parent },
|
||||||
|
{ WM_ACTIVATE, sent|parent|wparam, 1 },
|
||||||
|
{ WM_SETFOCUS, sent },
|
||||||
|
{ WM_COMMAND, sent|parent|wparam, MAKELONG(200, EN_SETFOCUS) },
|
||||||
|
{ WM_GETDLGCODE, sent|wparam|lparam, 0, 0 },
|
||||||
|
{ WM_USER, sent|parent },
|
||||||
|
{ WM_CHANGEUISTATE, sent|parent|optional },
|
||||||
|
{ 0 }
|
||||||
|
};
|
||||||
|
|
||||||
static void test_dialog_messages(void)
|
static void test_dialog_messages(void)
|
||||||
{
|
{
|
||||||
WNDCLASSA cls;
|
WNDCLASSA cls;
|
||||||
|
@ -12061,6 +12126,13 @@ static void test_dialog_messages(void)
|
||||||
DestroyWindow(hdlg);
|
DestroyWindow(hdlg);
|
||||||
flush_sequence();
|
flush_sequence();
|
||||||
|
|
||||||
|
hdlg = CreateDialogParamA(0, "FOCUS_TEST_DIALOG_3", 0, test_dlg_proc2, 0);
|
||||||
|
ok(IsWindow(hdlg), "CreateDialogParam failed\n");
|
||||||
|
ok_sequence(WmCreateDialogParamSeq_3, "CreateDialogParam_3", TRUE);
|
||||||
|
EndDialog(hdlg, 0);
|
||||||
|
DestroyWindow(hdlg);
|
||||||
|
flush_sequence();
|
||||||
|
|
||||||
UnregisterClassA(cls.lpszClassName, cls.hInstance);
|
UnregisterClassA(cls.lpszClassName, cls.hInstance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue