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.

199 lines
2.8 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1997 - 1998
  3. All rights reserved.
  4. Module Name:
  5. asyncdlg.hxx
  6. Abstract:
  7. Asynchronous Dialog header.
  8. Author:
  9. Steve Kiraly (SteveKi) 10-Feb-1997
  10. Revision History:
  11. --*/
  12. #ifndef _ASYNCDLG_HXX
  13. #define _ASYNCDLG_HXX
  14. /********************************************************************
  15. Forward reference.
  16. ********************************************************************/
  17. class TAsyncData;
  18. /********************************************************************
  19. TAsynchronous Dialog class.
  20. ********************************************************************/
  21. class TAsyncDlg : public MGenericDialog, public MRefQuick
  22. {
  23. SIGNATURE( 'asyc' )
  24. ALWAYS_VALID
  25. SAFE_NEW
  26. public:
  27. TAsyncDlg(
  28. IN HWND hwnd,
  29. IN TAsyncData *pData,
  30. IN UINT uResourceId
  31. );
  32. ~TAsyncDlg(
  33. VOID
  34. );
  35. BOOL
  36. bDoModal(
  37. VOID
  38. );
  39. VOID
  40. vSetTitle(
  41. IN LPCTSTR pszTitle
  42. );
  43. BOOL
  44. bIsActive(
  45. VOID
  46. ) const;
  47. private:
  48. //
  49. // Operator = and copy are not defined.
  50. //
  51. TAsyncDlg &
  52. operator =(
  53. const TAsyncDlg &
  54. );
  55. TAsyncDlg(
  56. const TAsyncDlg &
  57. );
  58. VOID
  59. vRefZeroed(
  60. VOID
  61. );
  62. BOOL
  63. bHandleMessage(
  64. UINT uMsg,
  65. WPARAM wParam,
  66. LPARAM lParam
  67. );
  68. BOOL
  69. bHandle_InitDialog(
  70. VOID
  71. );
  72. BOOL
  73. bHandle_Destroy(
  74. VOID
  75. );
  76. BOOL
  77. bHandle_Command(
  78. UINT uMsg,
  79. WPARAM wParam,
  80. LPARAM lParam
  81. );
  82. VOID
  83. vTerminate(
  84. IN WPARAM wParam
  85. );
  86. BOOL
  87. bStartAsyncThread(
  88. VOID
  89. );
  90. static
  91. INT
  92. iProc(
  93. IN TAsyncDlg *pDlg
  94. );
  95. auto_ptr<TAsyncData> _pData;
  96. HWND _hWnd;
  97. UINT _uResourceId;
  98. TString _strTitle;
  99. BOOL _bActive;
  100. };
  101. /********************************************************************
  102. TAsynchronous data class.
  103. ********************************************************************/
  104. class TAsyncData
  105. {
  106. SIGNATURE( 'asyd' )
  107. ALWAYS_VALID
  108. SAFE_NEW
  109. public:
  110. TAsyncData(
  111. VOID
  112. );
  113. virtual
  114. ~TAsyncData(
  115. VOID
  116. );
  117. virtual
  118. BOOL
  119. bAsyncWork(
  120. IN TAsyncDlg *pDlg
  121. ) = 0;
  122. virtual
  123. BOOL
  124. bHandleMessage(
  125. IN TAsyncDlg *pDlg,
  126. IN UINT uMsg,
  127. IN WPARAM wParam,
  128. IN LPARAM lParam
  129. );
  130. private:
  131. //
  132. // Operator = and copy are not defined.
  133. //
  134. TAsyncData &
  135. operator =(
  136. const TAsyncData &
  137. );
  138. TAsyncData(
  139. const TAsyncData &
  140. );
  141. };
  142. #endif