Module: wine Branch: master Commit: 5688ffb7abb09469023a0bfe43595555962c5c4c URL: http://source.winehq.org/git/wine.git/?a=commit;h=5688ffb7abb09469023a0bfe43...
Author: Aric Stewart aric@codeweavers.com Date: Tue Apr 3 12:58:19 2007 -0500
comctl32: Propsheet exception fix.
Do not attempt to draw a page during WM_PAINT if there is no active page.
---
dlls/comctl32/propsheet.c | 1 + dlls/comctl32/tests/propsheet.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c index c84f23a..201e554 100644 --- a/dlls/comctl32/propsheet.c +++ b/dlls/comctl32/propsheet.c @@ -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;
diff --git a/dlls/comctl32/tests/propsheet.c b/dlls/comctl32/tests/propsheet.c index db71bfe..8627351 100644 --- a/dlls/comctl32/tests/propsheet.c +++ b/dlls/comctl32/tests/propsheet.c @@ -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(); }