mirror of
https://github.com/reactos/wine.git
synced 2024-11-26 13:10:28 +00:00
comctl32: Propsheet exception fix.
Do not attempt to draw a page during WM_PAINT if there is no active page.
This commit is contained in:
parent
e3d3d1823d
commit
5688ffb7ab
@ -3229,6 +3229,7 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
|
||||
WCHAR szBuffer[256];
|
||||
int nLength;
|
||||
|
||||
if (psInfo->active_page < 0) return 1;
|
||||
hdc = hdcParam ? hdcParam : BeginPaint(hwnd, &ps);
|
||||
if (!hdc) return 1;
|
||||
|
||||
|
@ -98,7 +98,42 @@ static void test_title(void)
|
||||
DestroyWindow(hdlg);
|
||||
}
|
||||
|
||||
static void test_nopage(void)
|
||||
{
|
||||
HPROPSHEETPAGE hpsp[1];
|
||||
PROPSHEETPAGEA psp;
|
||||
PROPSHEETHEADERA psh;
|
||||
HWND hdlg;
|
||||
|
||||
memset(&psp, 0, sizeof(psp));
|
||||
psp.dwSize = sizeof(psp);
|
||||
psp.dwFlags = 0;
|
||||
psp.hInstance = GetModuleHandleW(NULL);
|
||||
U(psp).pszTemplate = "prop_page1";
|
||||
U2(psp).pszIcon = NULL;
|
||||
psp.pfnDlgProc = page_dlg_proc;
|
||||
psp.lParam = 0;
|
||||
|
||||
hpsp[0] = CreatePropertySheetPageA(&psp);
|
||||
|
||||
memset(&psh, 0, sizeof(psh));
|
||||
psh.dwSize = sizeof(psh);
|
||||
psh.dwFlags = PSH_MODELESS | PSH_USECALLBACK;
|
||||
psh.pszCaption = "test caption";
|
||||
psh.nPages = 1;
|
||||
psh.hwndParent = GetDesktopWindow();
|
||||
U3(psh).phpage = hpsp;
|
||||
psh.pfnCallback = sheet_callback;
|
||||
|
||||
hdlg = (HWND)PropertySheetA(&psh);
|
||||
ShowWindow(hdlg,SW_NORMAL);
|
||||
SendMessage(hdlg, PSM_REMOVEPAGE, 0, 0);
|
||||
RedrawWindow(hdlg,NULL,NULL,RDW_UPDATENOW|RDW_ERASENOW);
|
||||
DestroyWindow(hdlg);
|
||||
}
|
||||
|
||||
START_TEST(propsheet)
|
||||
{
|
||||
test_title();
|
||||
test_nopage();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user