Expand Minimize
This topic has not yet been rated - Rate this topic

SHCreateDefaultExtractIcon function

Creates a standard icon extractor, whose defaults can be further configured via the IDefaultExtractIconInit interface.

Syntax


HRESULT SHCreateDefaultExtractIcon(
  REFIID riid,
  _Out_  void **ppv
);

Parameters

riid

Type: REFIID

A reference to interface ID.

ppv [out]

Type: void**

The address of IDefaultExtractIconInit interface pointer.

Return value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

The intended usage for this function is as follows:


IExtractIcon *pxi;

IDefaultExtractIconInit *pdxi;

HRESULT hr = SHCreateDefaultExtractIcon(IID_PPV_ARGS(&pdxi);

 if (SUCCEEDED(hr)) &&

      SUCCEEDED(hr = pdxi->SetFlags(GIL_PERCLASS)) &&

      SUCCEEDED(hr = pdxi->SetKey(hkey)) &&   // optional

      SUCCEEDED(hr = pdxi->SetNormalIcon(L"this.dll", 1)) &&

      SUCCEEDED(hr = pdxi->SetOpenIcon(NULL, SIID_FOLDEROPEN)) && // optional

      SUCCEEDED(hr = pdxi->SetDefaultIcon(NULL, SIID_FOLDER)) && // optional

      SUCCEEDED(hr = pdxi->SetShortcutIcon(L"this.dll", 2))) // optional

{

      hr = pdxi->QueryInterface(IID_PPV_ARGS(&pxi)) 

}

 if (pdxi)

{

    pdxi->Release();

}

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Shobjidl.h

DLL

Shell32.dll

 

 

Send comments about this topic to Microsoft

Build date: 11/28/2012

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.