Desktop Duplication API (IDXGIOutputDuplication)

Just starting out? Need help? Post your questions and find answers here.
atomo
User
User
Posts: 65
Joined: Thu May 22, 2008 10:32 pm

Desktop Duplication API (IDXGIOutputDuplication)

Post by atomo »

Hi,

I'm trying to use the IID_IDXGIOutputDuplication Interface to get an image of my desktop on Windows 8 but i can't find the CLSID and IID to use with CoCreateInstance.
Help needed please, i'm totaly noob with COM :oops:
Here is what i have already done :

Code: Select all

Structure DXGI_RATIONAL
  Numerator.i
  Denominator.i
EndStructure

Structure DXGI_MODE_DESC
  Width.i
  Height.i
  RefreshRate.DXGI_RATIONAL
  Format.i
  ScanlineOrdering.i
  Scaling.i
EndStructure  

Structure DXGI_OUTDUPL_POINTER_POSITION
  Position.POINT
  Visible.b
EndStructure  
  
Structure DXGI_OUTDUPL_DESC
  ModeDesc.DXGI_MODE_DESC
  Rotation.i
  DesktopImageInSystemMemory.b
EndStructure

Structure DXGI_OUTDUPL_FRAME_INFO
  LastPresentTime.q
  LastMouseUpdateTime.q
  AccumulatedFrames.i
  RectsCoalesced.b
  ProtectedContentMaskedOut.b
  PointerPosition.DXGI_OUTDUPL_POINTER_POSITION
  TotalMetadataBufferSize.i
  PointerShapeBufferSize.i
EndStructure

Structure DXGI_OUTDUPL_MOVE_RECT
  SourcePoint.POINT
  DestinationRect.RECT
EndStructure

Structure DXGI_OUTDUPL_POINTER_SHAPE_INFO
  Type.i
  Width.i
  Height.i
  Pitch.i
  HotSpot.POINT
EndStructure

Structure DXGI_MAPPED_RECT
  Pitch.i
  *pBits
EndStructure

Interface IDXGIResource
  GetEvictionPriority(*pEvictionPriority)
  GetSharedHandle(*pSharedHandle)
  GetUsage(*pUsage)
  SetEvictionPriority(EvictionPriority.i)
EndInterface

Interface IDXGIOutputDuplication
  GetDesc(*pDesc.DXGI_OUTDUPL_DESC)
  AcquireNextFrame(TimeoutInMilliseconds.i, *pFrameInfo.DXGI_OUTDUPL_FRAME_INFO, *ppDesktopResource.IDXGIResource)
  GetFrameDirtyRects(DirtyRectsBufferSize.i, *pDirtyRectsBuffer.RECT, *pDirtyRectsBufferSizeRequired)  
  GetFrameMoveRects(MoveRectsBufferSize.i, *pMoveRectBuffer.DXGI_OUTDUPL_MOVE_RECT, *pMoveRectsBufferSizeRequired)  
  GetFramePointerShape(PointerShapeBufferSize.i, *pPointerShapeBuffer, *pPointerShapeBufferSizeRequired, *pPointerShapeInfo.DXGI_OUTDUPL_POINTER_SHAPE_INFO)
  MapDesktopSurface(*pLockedRect.DXGI_MAPPED_RECT)
  UnMapDesktopSurface()
  ReleaseFrame()
EndInterface
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: Desktop Duplication API (IDXGIOutputDuplication)

Post by Thunder93 »

IID_IDXGIOutputDuplication would be 191cfac3-a341-470d-b26e-a864f428319c
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: Desktop Duplication API (IDXGIOutputDuplication)

Post by Thunder93 »

Here is what I came up with..
136 MIDL_INTERFACE("ea9dbf1a-c88e-4486-854a-98aa0138f30c")

137 IDXGIDisplayControl : public IUnknown

138 {

139 public:

140 virtual BOOL STDMETHODCALLTYPE IsStereoEnabled( void) = 0;

--------------------------------------------------------------------------------

280 MIDL_INTERFACE("191cfac3-a341-470d-b26e-a864f428319c")

281 IDXGIOutputDuplication : public IDXGIObject

282 {

283 public:

284 virtual void STDMETHODCALLTYPE GetDesc(

--------------------------------------------------------------------------------

540 MIDL_INTERFACE("aba496dd-b617-4cb8-a866-bc44d7eb1fa2")

541 IDXGISurface2 : public IDXGISurface1

542 {

543 public:

544 virtual HRESULT STDMETHODCALLTYPE GetResource(


ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
atomo
User
User
Posts: 65
Joined: Thu May 22, 2008 10:32 pm

Re: Desktop Duplication API (IDXGIOutputDuplication)

Post by atomo »

Thanks for the IID, do you know where can i find the CLSID ?
Post Reply