Leaked source code of windows server 2003
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.

98 lines
2.5 KiB

  1. /*****************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORPORATION, 2000
  4. *
  5. * TITLE: status.h
  6. *
  7. * VERSION: 1.0
  8. *
  9. * AUTHOR: RickTu
  10. *
  11. * DATE: 11/8/00
  12. *
  13. * DESCRIPTION: status page class definition
  14. *
  15. *****************************************************************************/
  16. #ifndef _PRINT_PHOTOS_WIZARD_STATUS_PAGE_DLG_PROC_
  17. #define _PRINT_PHOTOS_WIZARD_STATUS_PAGE_DLG_PROC_
  18. #define PP_STATUS_PRINT (WM_USER+300)
  19. #define SP_MSG_UPDATE_PROGRESS_TEXT (WM_USER+301) // wParam = cur page, lParam = total pages
  20. #define SP_MSG_JUMP_TO_PAGE (WM_USER+302) // lParam = offset (+1, -1) from current page
  21. class CWizardInfoBlob;
  22. class CStatusPage
  23. {
  24. public:
  25. CStatusPage( CWizardInfoBlob * pBlob );
  26. ~CStatusPage();
  27. INT_PTR DoHandleMessage( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
  28. VOID ShutDownBackgroundThreads();
  29. private:
  30. // window message handlers
  31. LRESULT _OnInitDialog();
  32. LRESULT _OnDestroy();
  33. LRESULT _OnNotify(WPARAM wParam, LPARAM lParam);
  34. // thread message handlers
  35. VOID _DoHandleThreadMessage( LPMSG pMSG );
  36. // cancel printing
  37. VOID _CancelPrinting();
  38. // worker thread proc
  39. static DWORD s_StatusWorkerThreadProc( LPVOID lpv )
  40. {
  41. WIA_PUSH_FUNCTION_MASK((0x80, TEXT("CStatusPage::s_StatusWorkerThreadProc()")));
  42. MSG msg;
  43. LONG lRes = 0;
  44. CStatusPage * pSP = (CStatusPage *)lpv;
  45. HMODULE hDll = GetThreadHMODULE( s_StatusWorkerThreadProc );
  46. HRESULT hrCo = PPWCoInitialize();
  47. if (pSP)
  48. {
  49. PeekMessage( &msg, NULL, WM_USER, WM_USER, PM_NOREMOVE );
  50. do {
  51. lRes = GetMessage( &msg, NULL, 0, 0 );
  52. if (lRes > 0)
  53. {
  54. pSP->_DoHandleThreadMessage( &msg );
  55. }
  56. } while ( (lRes != 0) && (lRes != -1) );
  57. }
  58. WIA_TRACE((TEXT("s_StatusWorkerThreadProc: exiting thread now...")));
  59. PPWCoUninitialize(hrCo);
  60. if (hDll)
  61. {
  62. FreeLibraryAndExitThread( hDll, 0 );
  63. }
  64. return 0;
  65. }
  66. private:
  67. CWizardInfoBlob * _pWizInfo;
  68. HWND _hDlg;
  69. HANDLE _hWorkerThread;
  70. DWORD _dwWorkerThreadId;
  71. };
  72. #endif