Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

39 lines
1.2 KiB

#include "shellprv.h"
#pragma hdrstop
#include "printer.h"
// PRINTUI.DLL calls this export to load shell exts registered for this printer
STDAPI_(void) Printer_AddPrinterPropPages(LPCTSTR pszPrinterName, LPPROPSHEETHEADER lpsh)
{
// Add hooked pages if they exist in the registry
HKEY hkeyBaseProgID = NULL;
RegOpenKey(HKEY_CLASSES_ROOT, c_szPrinters, &hkeyBaseProgID);
if (hkeyBaseProgID)
{
// we need an IDataObject
LPITEMIDLIST pidl;
HRESULT hr = ParsePrinterNameEx(pszPrinterName, &pidl, TRUE, 0, 0);
if (SUCCEEDED(hr))
{
IDataObject *pdtobj;
hr = SHGetUIObjectFromFullPIDL(pidl, NULL, IID_PPV_ARG(IDataObject, &pdtobj));
if (SUCCEEDED(hr))
{
// add the hooked pages
HDCA hdca = DCA_Create();
if (hdca)
{
DCA_AddItemsFromKey(hdca, hkeyBaseProgID, STRREG_SHEX_PROPSHEET);
DCA_AppendClassSheetInfo(hdca, hkeyBaseProgID, lpsh, pdtobj);
DCA_Destroy(hdca);
}
pdtobj->lpVtbl->Release(pdtobj);
}
ILFree(pidl);
}
RegCloseKey(hkeyBaseProgID);
}
}