다음을 통해 공유


IPublishingWizard 인터페이스(shobjidl.h)

온라인 인쇄 마법사, 웹 게시 마법사 및 네트워크 위치 추가 마법사를 사용하는 메서드를 노출합니다. Windows Vista에서 IPublishingWizard 는 더 이상 웹 게시 마법사 또는 온라인 인쇄 마법사를 지원하지 않습니다.

상속

IPublishingWizard 인터페이스는 IWizardExtension에서 상속됩니다. IPublishingWizard 에는 다음과 같은 유형의 멤버도 있습니다.

메서드

IPublishingWizard 인터페이스에는 이러한 메서드가 있습니다.

 
IPublishingWizard::GetTransferManifest

온라인 인쇄 마법사 또는 네트워크 위치 추가 마법사와 같이 게시 마법사에서 수행하는 파일 전송 작업에 대한 전송 매니페스트를 가져옵니다.
IPublishingWizard::Initialize

전송할 파일, 사용할 설정 및 만들 마법사 유형을 사용하여 게시 마법사 개체를 초기화합니다.

설명

온라인 인쇄 마법사는 온라인으로 사진 인쇄를 주문하는 마법사입니다. Windows Vista에서는 IPublishingWizard 를 사용하여 온라인 인쇄 마법사를 사용할 수 없습니다.

네트워크 위치 추가 마법사를 사용하면 사용자가 내 네트워크 Places(Windows XP) 또는 컴퓨터(Windows Vista의 경우)에서 네트워크 리소스에 대한 바로 가기를 만들 수 있습니다.

Windows 셸은 IPublishingWizardIWizardExtension을 구현하는 게시 마법사 개체를 제공합니다. IPublishingWizard의 메서드는 마법사 유형을 초기화하고, 마법사의 특정 특성을 설정하고, 전송 매니페스트를 검색하는 데 사용됩니다. IWizardExtension의 메서드는 선택한 마법사의 본문을 구성하는 확장 페이지를 검색하는 데 사용됩니다. 게시 마법사 개체를 인스턴스화하려면 CoCreateInstance를 호출하고 CLSID(클래스 식별자) CLSID_PublishingWizard 사용하고 IID_IPublishingWizard REFIID로 사용합니다.

IPublishingWizard *pPublish = NULL;

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

게시 마법사 개체가 인스턴스화되면 IPublishingWizard::Initialize를 호출하여 게시 마법사 개체를 초기화합니다.

참고IPublishingWizard 메서드가 Windows Vista의 온라인 인쇄 마법사를 더 이상 지원하지 않으므로 아래 예제는 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.

IPublishingWizard::Initialize는 실제로 마법사를 표시하지 않습니다. 온라인 인쇄 마법사를 표시하려면 PROPSHEETHEADER 구조를 만든 다음 IWizardExtension::AddPages에서 반환된 PROPSHEETPAGE 핸들의 배열을 포함하도록 해당 phpage 멤버를 수정해야 합니다. IWizardExtension::AddPagesIPublishingWizard를 구현하는 동일한 게시 마법사 개체에 의해 구현됩니다.

온라인 인쇄 마법사를 표시하는 경우 확장 페이지를 포함하는 PROPSHEETHEADER 구조체의 dwFlags 멤버에서 PSH_NOMARGIN 플래그를 설정해야 합니다.

IWizardExtension::AddPages에서 검색된 확장 페이지 외에도 phpage 배열에는 애플리케이션에서 제공하는 시작 페이지, 취소 페이지 및 완료 페이지가 포함되어야 합니다. 사용자가 확장을 철회하거나 취소하거나 확장이 해당 페이지 표시를 마치면 확장은 확장 페이지 스택에서 이러한 애플리케이션 제공 페이지 중 하나로 이동해야 한다는 마법사와 통신합니다. 애플리케이션은 이 통신을 처리하는 IWizardSite 구현을 제공해야 합니다. IPublishingWizard 개체의 사이트를 IWizardSite 구현으로 설정해야 합니다. IUnknown_SetSite 함수를 사용하여 사이트를 설정할 수 있습니다. 애플리케이션이 IPublishingWizard::Initialize를 사용하여 마법사 설정을 지정하고 PROPSHEETHEADER 구조체의 phpage 멤버를 제대로 채우고 사이트를 IWizardSite의 구현으로 설정하면 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);
}

요구 사항

요구 사항
지원되는 최소 클라이언트 Windows XP, Windows Vista [데스크톱 앱만 해당]
지원되는 최소 서버 Windows Server 2008 [데스크톱 앱만 해당]
대상 플랫폼 Windows
헤더 shobjidl.h

추가 정보

IWizardExtension

IWizardExtension::AddPages

IWizardSite

PROPSHEETHEADER

게시 마법사 개체