Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.7 KiB

  1. // DataCallback.h: interface for the CDataCallback class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #ifndef _INC_DATACALLBACK
  5. #define _INC_DATACALLBACK
  6. #include "resource.h"
  7. #include "cwia.h"
  8. #include "Mainfrm.h"
  9. #define WM_STATUS WM_USER+5
  10. // IWiaDataCallback
  11. class CWiaDataCallback : public IWiaDataCallback
  12. {
  13. private:
  14. ULONG m_cRef; // Object reference count.
  15. PBYTE m_pBuffer; // complete data buffer
  16. LONG m_MemBlockSize;
  17. LONG m_BytesTransfered;
  18. GUID m_cFormat;
  19. CMainFrame* m_pMainFrm;
  20. HWND m_hPreviewWnd;
  21. long m_lPageCount;
  22. public:
  23. CWiaDataCallback();
  24. ~CWiaDataCallback();
  25. // IUnknown members that delegate to m_pUnkRef.
  26. HRESULT _stdcall QueryInterface(const IID&,void**);
  27. ULONG _stdcall AddRef();
  28. ULONG _stdcall Release();
  29. HRESULT _stdcall Initialize(HWND hPreviewWnd = NULL);
  30. HRESULT _stdcall BandedDataCallback(
  31. LONG lMessage,
  32. LONG lStatus,
  33. LONG lPercentComplete,
  34. LONG lOffset,
  35. LONG lLength,
  36. LONG lReserved,
  37. LONG lResLength,
  38. BYTE* pbBuffer);
  39. //
  40. // helpers
  41. //
  42. BYTE* _stdcall GetDataPtr();
  43. private:
  44. void PaintPreviewWindow(long lOffset);
  45. void ScaleBitmapToDC(HDC hDC, HDC hDCM, LPRECT lpDCRect, LPRECT lpDIBRect);
  46. void ScreenRectToClientRect(HWND hWnd,LPRECT pRect);
  47. };
  48. #endif