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.

65 lines
2.9 KiB

  1. // --------------------------------------------------------------------------
  2. // Module Name: WarningDialog.h
  3. //
  4. // Copyright (c) 2000, Microsoft Corporation
  5. //
  6. // Class to manage dialog presentation for warnings and errors on termination
  7. // of bad applications.
  8. //
  9. // History: 2000-08-31 vtan created
  10. // 2000-11-04 vtan moved from fusapi to fussrv
  11. // --------------------------------------------------------------------------
  12. #ifndef _WarningDialog_
  13. #define _WarningDialog_
  14. #include "CountedObject.h"
  15. // --------------------------------------------------------------------------
  16. // CWarningDialog
  17. //
  18. // Purpose: Implements a class that presents warning and error dialogs in
  19. // the FUS client DLL.
  20. //
  21. // History: 2000-08-31 vtan created
  22. // --------------------------------------------------------------------------
  23. class CWarningDialog : public CCountedObject
  24. {
  25. private:
  26. CWarningDialog (void);
  27. public:
  28. CWarningDialog (HINSTANCE hInstance, HWND hwndParent, const WCHAR *pszApplication, const WCHAR *pszUser);
  29. ~CWarningDialog (void);
  30. INT_PTR ShowPrompt (bool fCanShutdownApplication);
  31. void ShowFailure (void);
  32. void ShowProgress (DWORD dwTickRefresh, DWORD dwTickMaximum);
  33. void CloseDialog (void);
  34. private:
  35. void CenterWindow (HWND hwnd);
  36. void Handle_Prompt_WM_INITDIALOG (HWND hwnd);
  37. static INT_PTR CALLBACK PromptDialogProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  38. void Handle_Progress_WM_INITDIALOG (HWND hwnd);
  39. void Handle_Progress_WM_DESTROY (HWND hwnd);
  40. static INT_PTR CALLBACK ProgressDialogProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  41. static void CALLBACK ProgressTimerProc (HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
  42. private:
  43. HINSTANCE _hInstance;
  44. HMODULE _hModuleComctlv6;
  45. HWND _hwndParent;
  46. HWND _hwnd;
  47. bool _fCanShutdownApplication;
  48. UINT _uiTimerID;
  49. DWORD _dwTickStart,
  50. _dwTickRefresh,
  51. _dwTickMaximum;
  52. WCHAR _szApplication[MAX_PATH];
  53. const WCHAR *_pszUser;
  54. };
  55. #endif /* _WarningDialog_ */