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.

319 lines
7.2 KiB

  1. // QueryStatus.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "viewex.h"
  5. #include "qstatus.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CQueryStatus dialog
  13. /***********************************************************
  14. Function:
  15. Arguments:
  16. Return:
  17. Purpose:
  18. Author(s):
  19. Revision:
  20. Date:
  21. ***********************************************************/
  22. CQueryStatus::CQueryStatus(CWnd* pParent /*=NULL*/)
  23. : CDialog(CQueryStatus::IDD, pParent)
  24. {
  25. //{{AFX_DATA_INIT(CQueryStatus)
  26. //}}AFX_DATA_INIT
  27. m_nUser = 0;
  28. m_nGroup = 0;
  29. m_nService = 0;
  30. m_nFileService = 0;
  31. m_nPrintQueue = 0;
  32. m_nToDisplay = 0;
  33. m_nComputer = 0;
  34. m_nOtherObjects = 0;
  35. m_pbAbort = NULL;
  36. }
  37. /***********************************************************
  38. Function:
  39. Arguments:
  40. Return:
  41. Purpose:
  42. Author(s):
  43. Revision:
  44. Date:
  45. ***********************************************************/
  46. void CQueryStatus::DoDataExchange(CDataExchange* pDX)
  47. {
  48. CDialog::DoDataExchange(pDX);
  49. //{{AFX_DATA_MAP(CQueryStatus)
  50. //}}AFX_DATA_MAP
  51. }
  52. BEGIN_MESSAGE_MAP(CQueryStatus, CDialog)
  53. //{{AFX_MSG_MAP(CQueryStatus)
  54. ON_BN_CLICKED(IDCANCEL, OnStop)
  55. //}}AFX_MSG_MAP
  56. END_MESSAGE_MAP()
  57. /////////////////////////////////////////////////////////////////////////////
  58. // CQueryStatus message handlers
  59. /***********************************************************
  60. Function:
  61. Arguments:
  62. Return:
  63. Purpose:
  64. Author(s):
  65. Revision:
  66. Date:
  67. ***********************************************************/
  68. void CQueryStatus::IncrementType( DWORD dwType, BOOL bDisplay )
  69. {
  70. switch( dwType )
  71. {
  72. case USER:
  73. m_nUser++;
  74. break;
  75. case GROUP:
  76. m_nGroup++;
  77. break;
  78. case SERVICE:
  79. m_nService++;
  80. break;
  81. case FILESERVICE:
  82. m_nFileService++;
  83. break;
  84. case PRINTQUEUE:
  85. m_nPrintQueue++;
  86. break;
  87. case COMPUTER:
  88. m_nComputer++;
  89. break;
  90. default:
  91. m_nOtherObjects++;
  92. break;
  93. }
  94. if( bDisplay )
  95. {
  96. m_nToDisplay++;
  97. }
  98. DisplayStatistics( );
  99. UpdateWindow( );
  100. MSG aMsg;
  101. while( PeekMessage( &aMsg, NULL, 0, 0, PM_REMOVE ) &&
  102. !IsDialogMessage( &aMsg ) )
  103. {
  104. TranslateMessage( &aMsg );
  105. DispatchMessage( &aMsg );
  106. }
  107. }
  108. /***********************************************************
  109. Function:
  110. Arguments:
  111. Return:
  112. Purpose:
  113. Author(s):
  114. Revision:
  115. Date:
  116. ***********************************************************/
  117. void CQueryStatus::DisplayStatistics( void )
  118. {
  119. SetDlgItemInt( IDS_USER, m_nUser );
  120. SetDlgItemInt( IDS_GROUP, m_nGroup );
  121. SetDlgItemInt( IDS_SERVICE, m_nService );
  122. SetDlgItemInt( IDS_FILESERVICE, m_nFileService );
  123. SetDlgItemInt( IDS_PRINTQUEUE, m_nPrintQueue );
  124. SetDlgItemInt( IDS_OTHEROBJECTS, m_nOtherObjects );
  125. SetDlgItemInt( IDS_COMPUTER, m_nComputer );
  126. SetDlgItemInt( IDC_ITEMSTODISPLAY, m_nToDisplay );
  127. }
  128. /***********************************************************
  129. Function:
  130. Arguments:
  131. Return:
  132. Purpose:
  133. Author(s):
  134. Revision:
  135. Date:
  136. ***********************************************************/
  137. BOOL CQueryStatus::OnInitDialog()
  138. {
  139. CDialog::OnInitDialog();
  140. // TODO: Add extra initialization here
  141. DisplayStatistics( );
  142. return TRUE; // return TRUE unless you set the focus to a control
  143. // EXCEPTION: OCX Property Pages should return FALSE
  144. }
  145. /***********************************************************
  146. Function:
  147. Arguments:
  148. Return:
  149. Purpose:
  150. Author(s):
  151. Revision:
  152. Date:
  153. ***********************************************************/
  154. void CQueryStatus::SetAbortFlag( BOOL* pAbort )
  155. {
  156. m_pbAbort = pAbort;
  157. *pAbort = FALSE;
  158. }
  159. /***********************************************************
  160. Function:
  161. Arguments:
  162. Return:
  163. Purpose:
  164. Author(s):
  165. Revision:
  166. Date:
  167. ***********************************************************/
  168. void CQueryStatus::OnStop()
  169. {
  170. // TODO: Add your control notification handler code here
  171. if( NULL != m_pbAbort )
  172. {
  173. *m_pbAbort = TRUE;
  174. }
  175. }
  176. /////////////////////////////////////////////////////////////////////////////
  177. // CDeleteStatus dialog
  178. CDeleteStatus::CDeleteStatus(CWnd* pParent /*=NULL*/)
  179. : CDialog(CDeleteStatus::IDD, pParent)
  180. {
  181. //{{AFX_DATA_INIT(CDeleteStatus)
  182. // NOTE: the ClassWizard will add member initialization here
  183. //}}AFX_DATA_INIT
  184. m_pbAbort = NULL;
  185. }
  186. void CDeleteStatus::DoDataExchange(CDataExchange* pDX)
  187. {
  188. CDialog::DoDataExchange(pDX);
  189. //{{AFX_DATA_MAP(CDeleteStatus)
  190. // NOTE: the ClassWizard will add DDX and DDV calls here
  191. //}}AFX_DATA_MAP
  192. }
  193. BEGIN_MESSAGE_MAP(CDeleteStatus, CDialog)
  194. //{{AFX_MSG_MAP(CDeleteStatus)
  195. ON_BN_CLICKED(IDCANCEL, OnStop)
  196. //}}AFX_MSG_MAP
  197. END_MESSAGE_MAP()
  198. /***********************************************************
  199. Function:
  200. Arguments:
  201. Return:
  202. Purpose:
  203. Author(s):
  204. Revision:
  205. Date:
  206. ***********************************************************/
  207. void CDeleteStatus::SetAbortFlag( BOOL* pAbort )
  208. {
  209. m_pbAbort = pAbort;
  210. *pAbort = FALSE;
  211. }
  212. /***********************************************************
  213. Function:
  214. Arguments:
  215. Return:
  216. Purpose:
  217. Author(s):
  218. Revision:
  219. Date:
  220. ***********************************************************/
  221. void CDeleteStatus::SetCurrentObjectText ( TCHAR* szName )
  222. {
  223. SetDlgItemText( IDC_CURRENTDELETEOBJECT, szName );
  224. UpdateWindow( );
  225. MSG aMsg;
  226. while( PeekMessage( &aMsg, NULL, 0, 0, PM_REMOVE ) &&
  227. !IsDialogMessage( &aMsg ) )
  228. {
  229. TranslateMessage( &aMsg );
  230. DispatchMessage( &aMsg );
  231. }
  232. }
  233. /***********************************************************
  234. Function:
  235. Arguments:
  236. Return:
  237. Purpose:
  238. Author(s):
  239. Revision:
  240. Date:
  241. ***********************************************************/
  242. void CDeleteStatus::SetStatusText( TCHAR* szStatus )
  243. {
  244. //SetDlgItemText( IDC_DELETESTATUS, szStatus );
  245. GetDlgItem( IDC_DELETESTATUS )->ShowWindow( SW_HIDE );
  246. //UpdateWindow( );
  247. /*MSG aMsg;
  248. while( PeekMessage( &aMsg, NULL, 0, 0, PM_REMOVE ) &&
  249. !IsDialogMessage( &aMsg ) )
  250. {
  251. TranslateMessage( &aMsg );
  252. DispatchMessage( &aMsg );
  253. }*/
  254. }
  255. /////////////////////////////////////////////////////////////////////////////
  256. // CDeleteStatus message handlers
  257. void CDeleteStatus::OnStop()
  258. {
  259. // TODO: Add your control notification handler code here
  260. if( NULL != m_pbAbort )
  261. {
  262. *m_pbAbort = TRUE;
  263. }
  264. }