Home COM GDI+ WebBrowser Data Access

IExtractImage  Interface

 

IID_IExtractImage

{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}

 

 

The IExtractImage interface is used to request a thumbnail image from a Shell folder.

 

Remarks

 

There are two steps to the process. First, use GetLocation to request the path description of an image and specify how the image should be rendered. Then, call Extract to extract the image.

 

If the object is free-threaded it must also expose an IRunnableTask interface, so it can be stopped and started as needed. This feature can be particularly useful when extraction may be slow.

 

Implement IExtractImage if your namespace extension needs to provide thumbnail images to be displayed in a Shellview.

 

Use IExtractImage if you are implementing a view of namespace objects, and want to display thumbnail images. You can use a Shell folder's IShellFolder::GetUIObjectOf method to bind to its IExtractImage interface.

 

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

IExtractImage Methods

Description

GetLocation

Used to request the path description of an image and specify how the image should be rendered.

Extract

Used to request an image from an object, such as an item in a Shell folder.

 

IExtractImage interface implementation

 


$IID_IExtractImage = GUID$("{C1FB73D0-EC3A-4ba2-B512-8CDB9187B6D1}")

' ****************************************************************************************
' IExtractImage interface
' ****************************************************************************************
TYPE IExtractImageVtbl
   ' IUnknown methods
   pQueryInterface          AS DWORD          ' // QueryInterface method
   pAddRef                  AS DWORD          ' // AddRef method
   pRelease                 AS DWORD          ' // Release method
   ' IExtractImage members
   pGetLocation             AS DWORD          ' // GetLocation method
   pExtract                 AS DWORD          ' // Extract method
   ' Custom data
   pVtblAddr                AS DWORD          ' // Address of the virtual table
   cRef                     AS DWORD          ' // Reference count
END TYPE
' ****************************************************************************************

' ****************************************************************************************
' Builds the IExtractImage Virtual Table
' Returns a cookie that is a pointer to a IExtractImageVtbl structure.
' ****************************************************************************************
FUNCTION IExtractImage_BuildVtbl () AS DWORD

   LOCAL pVtbl AS IExtractImageVtbl PTR
   LOCAL pUnk AS IExtractImageVtbl PTR

   pVtbl = HeapAlloc(GetProcessHeap(), %HEAP_ZERO_MEMORY, SIZEOF(@pVtbl))
   IF pVtbl = 0 THEN EXIT FUNCTION

   @pVtbl.pQueryInterface          = CODEPTR(IExtractImage_QueryInterface)
   @pVtbl.pAddRef                  = CODEPTR(IExtractImage_AddRef)
   @pVtbl.pRelease                 = CODEPTR(IExtractImage_Release)

   @pVtbl.pGetLocation             = CODEPTR(IExtractImage_GetLocation)
   @pVtbl.pExtract                 = CODEPTR(IExtractImage_Extract)

   @pVtbl.pVtblAddr                = pVtbl
   @pVtbl.cRef                     = 1

   pUnk = VARPTR(@pVtbl.pVtblAddr)
   FUNCTION = pUnk

END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' IExtractImage_QueryInterface method
' Returns the IUnknown of our class and increments the reference counter.
' ****************************************************************************************
FUNCTION IExtractImage_QueryInterface (BYVAL pCookie AS IExtractImageVtbl PTR, BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS LONG
   IF riid = $IID_IExtractImage THEN
      ppvObj = pCookie
      INCR @@pCookie.cRef
      FUNCTION = %S_OK
   ELSE
      FUNCTION = %E_NOINTERFACE
   END IF
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' IExtractImage_AddRef method
' Increments the reference counter.
' ****************************************************************************************
FUNCTION IExtractImage_AddRef (BYVAL pCookie AS IExtractImageVtbl PTR) AS DWORD
   INCR @@pCookie.cRef
   FUNCTION = @@pCookie.cRef
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' IExtractImage_Release method
' Releases our class if there is only a reference to him and decrements the reference counter.
' ****************************************************************************************
FUNCTION IExtractImage_Release (BYVAL pCookie AS IExtractImageVtbl PTR) AS DWORD
   DECR @@pCookie.cRef
   FUNCTION = @@pCookie.cRef
   IF @@pCookie.cRef = 0 THEN
      IF ISTRUE @@pCookie.pVtblAddr THEN
         HeapFree(GetProcessHeap(), 0, BYVAL @@pCookie.pVtblAddr)
      END IF
   END IF
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Used to request the path description of an image and specify how the image should be rendered.
' ****************************************************************************************
FUNCTION IExtractImage_GetLocation (BYVAL pCookie AS IExtractImageVtbl PTR, BYREF pszPathBuffer AS DWORD, BYVAL cch AS DWORD, BYREF pdwPriority AS DWORD, BYREF prgSize AS APISIZE, BYVAL dwRecClrDepth AS DWORD, BYREF pdwFlags AS DWORD) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************

' ****************************************************************************************
' Used to request an image from an object, such as an item in a Shell folder.
' ****************************************************************************************
FUNCTION IExtractImage_Extract (BYVAL pCookie AS IExtractImageVtbl PTR, BYVAL pszDeviceID AS DWORD, BYVAL pszAltDeviceID AS DWORD, BYREF phBmpThumbnail AS DWORD) AS LONG
   ' Put your code here
END FUNCTION
' ****************************************************************************************
 

 

Page last updated on Monday, 03 April 2006 20:39:39 +0200