Commit aefd67ff authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

comctl32: Use HPROPSHEETPAGE directly in PROPSHEET_CreatePage.

parent c7b5108c
......@@ -1341,7 +1341,7 @@ static UINT GetTemplateSize(const DLGTEMPLATE* pTemplate)
static BOOL PROPSHEET_CreatePage(HWND hwndParent,
int index,
const PropSheetInfo * psInfo,
LPCPROPSHEETPAGEW ppshpage)
HPROPSHEETPAGE hpsp)
{
const DLGTEMPLATE* pTemplate;
HWND hwndPage;
......@@ -1350,30 +1350,30 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
TRACE("index %d\n", index);
if (ppshpage == NULL)
if (hpsp == NULL)
{
return FALSE;
}
if (ppshpage->dwFlags & PSP_DLGINDIRECT)
if (hpsp->psp.dwFlags & PSP_DLGINDIRECT)
{
pTemplate = ppshpage->u.pResource;
pTemplate = hpsp->psp.u.pResource;
resSize = GetTemplateSize(pTemplate);
}
else if(ppshpage->dwFlags & PSP_INTERNAL_UNICODE)
else if(hpsp->psp.dwFlags & PSP_INTERNAL_UNICODE)
{
HRSRC hResource;
HANDLE hTemplate;
hResource = FindResourceW(ppshpage->hInstance,
ppshpage->u.pszTemplate,
hResource = FindResourceW(hpsp->psp.hInstance,
hpsp->psp.u.pszTemplate,
(LPWSTR)RT_DIALOG);
if(!hResource)
return FALSE;
resSize = SizeofResource(ppshpage->hInstance, hResource);
resSize = SizeofResource(hpsp->psp.hInstance, hResource);
hTemplate = LoadResource(ppshpage->hInstance, hResource);
hTemplate = LoadResource(hpsp->psp.hInstance, hResource);
if(!hTemplate)
return FALSE;
......@@ -1387,15 +1387,15 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
HRSRC hResource;
HANDLE hTemplate;
hResource = FindResourceA(ppshpage->hInstance,
(LPCSTR)ppshpage->u.pszTemplate,
hResource = FindResourceA(hpsp->psp.hInstance,
(LPCSTR)hpsp->psp.u.pszTemplate,
(LPSTR)RT_DIALOG);
if(!hResource)
return FALSE;
resSize = SizeofResource(ppshpage->hInstance, hResource);
resSize = SizeofResource(hpsp->psp.hInstance, hResource);
hTemplate = LoadResource(ppshpage->hInstance, hResource);
hTemplate = LoadResource(hpsp->psp.hInstance, hResource);
if(!hTemplate)
return FALSE;
......@@ -1439,21 +1439,20 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
}
if (psInfo->proppage[index].useCallback)
(*(ppshpage->pfnCallback))(0, PSPCB_CREATE,
(LPPROPSHEETPAGEW)ppshpage);
(*(hpsp->psp.pfnCallback))(0, PSPCB_CREATE, &hpsp->psp);
if(ppshpage->dwFlags & PSP_INTERNAL_UNICODE)
hwndPage = CreateDialogIndirectParamW(ppshpage->hInstance,
if(hpsp->psp.dwFlags & PSP_INTERNAL_UNICODE)
hwndPage = CreateDialogIndirectParamW(hpsp->psp.hInstance,
pTemplateCopy,
hwndParent,
ppshpage->pfnDlgProc,
(LPARAM)ppshpage);
hpsp->psp.pfnDlgProc,
(LPARAM)&hpsp->psp);
else
hwndPage = CreateDialogIndirectParamA(ppshpage->hInstance,
hwndPage = CreateDialogIndirectParamA(hpsp->psp.hInstance,
pTemplateCopy,
hwndParent,
ppshpage->pfnDlgProc,
(LPARAM)ppshpage);
hpsp->psp.pfnDlgProc,
(LPARAM)&hpsp->psp);
/* Free a no more needed copy */
Free(pTemplateCopy);
......@@ -1465,7 +1464,7 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
/* Subclass exterior wizard pages */
if((psInfo->ppshheader.dwFlags & (PSH_WIZARD97_NEW | PSH_WIZARD97_OLD)) &&
(psInfo->ppshheader.dwFlags & PSH_WATERMARK) &&
(ppshpage->dwFlags & PSP_HIDEHEADER))
(hpsp->psp.dwFlags & PSP_HIDEHEADER))
{
SetWindowSubclass(hwndPage, PROPSHEET_WizardSubclassProc, 1, 0);
}
......@@ -1525,10 +1524,9 @@ static BOOL PROPSHEET_ShowPage(HWND hwndDlg, int index, PropSheetInfo * psInfo)
return TRUE;
}
ppshpage = (LPCPROPSHEETPAGEW)psInfo->proppage[index].hpage;
if (psInfo->proppage[index].hwndPage == 0)
{
PROPSHEET_CreatePage(hwndDlg, index, psInfo, ppshpage);
PROPSHEET_CreatePage(hwndDlg, index, psInfo, psInfo->proppage[index].hpage);
}
if (psInfo->ppshheader.dwFlags & INTRNL_ANY_WIZARD)
......@@ -2009,7 +2007,7 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg,
psn.lParam = 0;
if (!psInfo->proppage[index].hwndPage) {
if(!PROPSHEET_CreatePage(hwndDlg, index, psInfo, ppshpage)) {
if(!PROPSHEET_CreatePage(hwndDlg, index, psInfo, psInfo->proppage[index].hpage)) {
PROPSHEET_RemovePage(hwndDlg, index, NULL);
if (!psInfo->isModeless)
......@@ -2247,7 +2245,6 @@ static BOOL PROPSHEET_InsertPage(HWND hwndDlg, HPROPSHEETPAGE hpageInsertAfter,
PropSheetInfo *psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
PropPageInfo *ppi, *prev_ppi = psInfo->proppage;
HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
LPCPROPSHEETPAGEW ppsp = (LPCPROPSHEETPAGEW)hpage;
TCITEMW item;
int index;
......@@ -2292,10 +2289,10 @@ static BOOL PROPSHEET_InsertPage(HWND hwndDlg, HPROPSHEETPAGE hpageInsertAfter,
psInfo->proppage[index].hpage = hpage;
if (ppsp->dwFlags & PSP_PREMATURE)
if (hpage->psp.dwFlags & PSP_PREMATURE)
{
/* Create the page but don't show it */
if (!PROPSHEET_CreatePage(hwndDlg, index, psInfo, ppsp))
if (!PROPSHEET_CreatePage(hwndDlg, index, psInfo, hpage))
{
psInfo->proppage = prev_ppi;
Free(ppi);
......
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