Commit 32f5dfde authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

user32: Send WM_CANCELMODE to the current capture window after initializing a modal dialog.

parent c75e0652
......@@ -667,6 +667,8 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
if (DIALOG_CreateControls32( hwnd, dlgTemplate, &template, hInst, unicode ))
{
HWND capture;
/* Send initialisation messages and set focus */
if (dlgProc)
......@@ -695,6 +697,9 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
}
}
if (modal_owner && (capture = GetCapture()))
SendMessageW( capture, WM_CANCELMODE, 0, 0 );
if (template.style & WS_VISIBLE && !(GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE))
{
ShowWindow( hwnd, SW_SHOWNORMAL ); /* SW_SHOW doesn't always work */
......
......@@ -2192,7 +2192,7 @@ static INT_PTR CALLBACK capture_release_proc(HWND dialog, UINT message, WPARAM w
HWND child = (HWND)lparam;
DWORD style;
todo_wine ok(!GetCapture(), "got capture %p\n", GetCapture());
ok(!GetCapture(), "got capture %p\n", GetCapture());
style = GetWindowLongA(child, GWL_STYLE);
ok(!(style & WS_DISABLED), "child should not be disabled\n");
......@@ -2233,12 +2233,12 @@ static void test_capture_release(void)
SetCapture(child);
ret = DialogBoxParamA(GetModuleHandleA(NULL), "TEST_EMPTY_DIALOG", NULL, capture_release_proc, (LPARAM)child);
ok(ret == 1, "got %#Ix\n", ret);
todo_wine ok(!GetCapture(), "got capture %p\n", GetCapture());
ok(!GetCapture(), "got capture %p\n", GetCapture());
SetCapture(child);
ret = DialogBoxParamA(GetModuleHandleA(NULL), "TEST_EMPTY_DIALOG", window, capture_release_proc, (LPARAM)child);
ok(ret == 1, "got %#Ix\n", ret);
todo_wine ok(!GetCapture(), "got capture %p\n", GetCapture());
ok(!GetCapture(), "got capture %p\n", GetCapture());
SetCapture(child);
dialog = CreateDialogParamA(GetModuleHandleA(NULL), "TEST_EMPTY_DIALOG",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment