1 /* Unit test suite for property sheet control.
3 * Copyright 2006 Huw Davies
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #define NONAMELESSUNION
21 #define NONAMELESSSTRUCT
26 #include "wine/test.h"
28 static int CALLBACK sheet_callback(HWND hwnd, UINT msg, LPARAM lparam)
32 case PSCB_INITIALIZED:
35 GetWindowTextA(hwnd, caption, sizeof(caption));
36 ok(!strcmp(caption,"test caption"), "caption: %s\n", caption);
43 static INT_PTR CALLBACK page_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
50 HWND sheet = GetParent(hwnd);
52 GetWindowTextA(sheet, caption, sizeof(caption));
53 ok(!strcmp(caption,"test caption"), "caption: %s\n", caption);
59 NMHDR *nmhdr = (NMHDR *)lparam;
73 static void test_title(void)
75 HPROPSHEETPAGE hpsp[1];
80 memset(&psp, 0, sizeof(psp));
81 psp.dwSize = sizeof(psp);
83 psp.hInstance = GetModuleHandleW(NULL);
84 psp.u.pszTemplate = "prop_page1";
85 psp.u2.pszIcon = NULL;
86 psp.pfnDlgProc = page_dlg_proc;
89 hpsp[0] = CreatePropertySheetPageA(&psp);
91 memset(&psh, 0, sizeof(psh));
92 psh.dwSize = sizeof(psh);
93 psh.dwFlags = PSH_MODELESS | PSH_USECALLBACK;
94 psh.pszCaption = "test caption";
96 psh.hwndParent = GetDesktopWindow();
98 psh.pfnCallback = sheet_callback;
100 hdlg = (HWND)PropertySheetA(&psh);
104 START_TEST(propsheet)