I want to add a preview on my window. A rectangle is passed into the function in which the preview will be drawn, but for some reason the preview is drawn in the entire window and not in the specified rectangle.
RECT rectPreview;
rectPreview.top=10;
rectPreview.left=10;
rectPreview.right=100;
rectPreview.bottom=100;
IPreviewHandler *pIPreviewHandler(NULL) ;
CoCreateInstance( cls, NULL, CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER, IID_IPreviewHandler, (LPVOID*)&pIPreviewHandler );
//some code
pIPreviewHandler->SetWindow( hWnd , &rectPreview );
pIPreviewHandler->SetRect( &rectPreview );
pIPreviewHandler->DoPreview( );
How to set the drawing rectangle so that the preview is only in it?
just need to call
SetRect
afterDoPreview