Condividi tramite


Interfaccia IPublishingWizard (shobjidl.h)

Espone i metodi per l'uso della Creazione guidata stampa online, della Pubblicazione guidata Web e della Procedura guidata Aggiungi posizione rete. In Windows Vista IPublishingWizard non supporta più la Creazione guidata pubblicazione Web o Stampa guidata online.

Ereditarietà

L'interfaccia IPublishingWizard eredita da IWizardExtension. IPublishingWizard include anche questi tipi di membri:

Metodi

L'interfaccia IPublishingWizard include questi metodi.

 
IPublishingWizard::GetTransferManifest

Ottiene un manifesto di trasferimento per un'operazione di trasferimento file eseguita da una procedura guidata per la pubblicazione, ad esempio la Creazione guidata stampa online o l'Aggiunta guidata posizione rete.
IPublishingWizard::Initialize

Inizializza l'oggetto Pubblicazione guidata con i file da trasferire, le impostazioni da usare e il tipo di procedura guidata da creare.

Commenti

La Procedura guidata stampa online è una procedura guidata per ordinare le stampe delle foto online. L'uso di IPublishingWizard per l'uso della Creazione guidata stampa online non è più supportato in Windows Vista.

La Procedura guidata Aggiungi posizione rete consente all'utente di creare un collegamento alle risorse di rete in My Network Places (in Windows XP) o Computer (in Windows Vista).

Windows Shell fornisce un oggetto Pubblicazione guidata che implementa IPublishingWizard e IWizardExtension. I metodi di IPublishingWizard vengono usati per inizializzare il tipo della procedura guidata, impostare determinati attributi della procedura guidata e recuperare un manifesto di trasferimento. I metodi di IWizardExtension vengono usati per recuperare le pagine di estensione che costituiscono il corpo della procedura guidata selezionata. Per creare un'istanza dell'oggetto Pubblicazione guidata, chiamare CoCreateInstance e usare l'identificatore di classe CLSID_PublishingWizard (CLSID) e IID_IPublishingWizard come REFIID.

IPublishingWizard *pPublish = NULL;

HRESULT hr = CoCreateInstance(CLSID_PublishingWizard, 
                              NULL,
                              CLSCTX_INPROC_SERVER, 
                              IID_IPublishingWizard, 
                              (LPVOID*)&pPublish);

Dopo aver creato un'istanza dell'oggetto Pubblicazione guidata , chiamare IPublishingWizard::Initialize per inizializzare l'oggetto Pubblicazione guidata.

Nota Gli esempi seguenti non funzioneranno in Windows Vista poiché i metodi IPublishingWizard non supportano più la Procedura guidata di stampa online in Windows Vista.
 
// Initializing the Online Print Wizard
                    
hr = pPublish->Initialize(pDataObject,
                          SHPWHF_NOFILESELECTOR,
                          L"InternetPhotoPrinting");
                          
// pDataObject: A data object that represents files or folders to transfer.
// SHPWHF_NOFILESELECTOR: This flag must be set.
// L"InternetPhotoPrinting": Display the Online Print Wizard.

Si noti che IPublishingWizard::Initialize non visualizza effettivamente la procedura guidata. Per visualizzare la Creazione guidata stampa online, è necessario creare una struttura PROPSHEETHEADER e quindi modificare il membro phpage per includere la matrice di handle PROPSHEETPAGE restituiti da IWizardExtension::AddPages. IWizardExtension::AddPages viene implementato dallo stesso oggetto Pubblicazione guidata che implementa IPublishingWizard.

Se viene visualizzata la Creazione guidata stampa online, il flag di PSH_NOMARGIN deve essere impostato nel membro dwFlags della struttura PROPSHEETHEADER che contiene le pagine di estensione.

Oltre alle pagine di estensione recuperate da IWizardExtension::AddPages, la matrice phpage deve includere una pagina iniziale, una pagina annulla e una pagina di fine, fornita dall'applicazione. Quando l'utente esegue il backup o annulla l'estensione oppure quando l'estensione termina la visualizzazione delle pagine, l'estensione comunica quindi alla procedura guidata che deve uscire dallo stack di pagine di estensione in una di queste pagine fornite dall'applicazione. L'applicazione deve fornire un'implementazione di IWizardSite che gestisce questa comunicazione. Il sito dell'oggetto IPublishingWizard deve essere impostato sull'implementazione di IWizardSite . La funzione IUnknown_SetSite può essere usata per impostare il sito. Dopo aver specificato le impostazioni della procedura guidata usando IPublishingWizard::Initialize, popolato correttamente il membro phpage di una struttura PROPSHEETHEADER e impostare il sito su un'implementazione di IWizardSite, la procedura guidata può essere visualizzata chiamando la funzione PropertySheet .

/* This is example code demonstrating how to populate a PROPSHEETHEADER
structure and use it to display the Online Print Wizard.
This sample assumes that the PublishingWizard object has already
been instantiated and initialized elsewhere in the application. */

// Define the number of wizard pages that we expect to get from 
// the Publishing Wizard object. 
// The Online Print Wizard provides 6 predefined pages in Windows Vista,
// but provided 9 in Windows XP. 
#if NTDDI_VERSION >= NTDDI_VISTA
#define NUMPAGES 6  
#else
#define NUMPAGES 9
#endif

// Number of wizard pages supplied by the application in addition to 
// the predefined pages supplied by the Online Print Wizard. 
#define NUMNONEXTENSIONPAGES 3

// Array to hold the property sheets to display in the wizard,
// including both those returned by IPublishingWizard::AddPages()
// and those application-defined pages returned by IWizardSite methods.
HPROPSHEETPAGE hPropSheets[NUMPAGES + NUMNONEXTENSIONPAGES];

// Handles to the application-defined property sheets.
// This example assumes that they are initialized elsewhere in the application.
HPROPSHEETPAGE hPropSheetFinishPage = CreateFinishPage;
HPROPSHEETPAGE hPropSheetStartPage = CreateStartPage;
HPROPSHEETPAGE hPropSheetCanceledPage = CreateCanceledPage;

// Number of property sheets returned by IPublishingWizard::AddPages().
UINT uCount = 0;
INT_PTR retval = 0; // return value from PropertySheet
HRESULT hr;

// Property sheet header structure whose phpage member will receive
// the array of wizard pages retrieved from AddPages.
PROPSHEETHEADER psh;
psh.dwSize = sizeof(PROPSHEETHEADER);

// Set the PublishingWizard object's site to an IWizardSite implementation
// defined by your application.  
hr = IUnknown_SetSite(pIPublish, (IUnknown *)pWizSite);

// Fill the hPropSheets array with the pages of the wizard.
if SUCCEEDED(hr)
{
    hr = pIPublish->AddPages(&hPropSheets[0], NUMPAGES, &uCount);
}        

if SUCCEEDED(hr)
{
    // Define start, finish, and canceled pages elsewhere in your application.
    // Here, these pages are added after the extension pages.
    hPropSheets[uCount] = hPropSheetFinishPage;
    hPropSheets[uCount + 1] = hPropSheetCanceledPage;
    hPropSheets[uCount + 2] = hPropSheetStartPage;

    // Assign the array of property sheets.
    psh.phpage = hPropSheets;

    // Number of extension pages from AddPages + # of your own pages.
    psh.nPages = uCount + NUMNONEXTENSIONPAGES; 

    // The index into phpage where the first page to display is located.
    psh.nStartPage = 0;  

    // PSH_NOMARGIN must be specified for the Online Print Wizard.
    psh.dwFlags =  PSH_AEROWIZARD | PSH_WIZARD | PSH_NOMARGIN;
    psh.hwndParent = NULL;
    psh.hInstance = NULL;

    // Display the wizard.
    PropertySheet(&psh);
}

Requisiti

Requisito Valore
Client minimo supportato Windows XP, Windows Vista [solo app desktop]
Server minimo supportato Windows Server 2008 [solo app desktop]
Piattaforma di destinazione Windows
Intestazione shobjidl.h

Vedi anche

IWizardExtension

IWizardExtension::AddPages

IWizardSite

PROPSHEETHEADER

Oggetto Pubblicazione guidata