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