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.

112 lines
2.1 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1998 - 1998
  3. All rights reserved.
  4. Module Name:
  5. msgbox.hxx
  6. Abstract:
  7. Message box function with help button.
  8. Author:
  9. Steve Kiraly (SteveKi) 04/29/98
  10. Revision History:
  11. --*/
  12. #ifndef _MSGBOX_HXX_
  13. #define _MSGBOX_HXX_
  14. //
  15. // Callback function called when the help button is clicked.
  16. //
  17. typedef BOOL (WINAPI *pfHelpCallback)( HWND hwnd, PVOID pRefData );
  18. //
  19. // Message box function that can handle the help button with
  20. // a windows that does not have a known parent.
  21. //
  22. INT
  23. PrintUIMessageBox(
  24. IN HWND hWnd,
  25. IN LPCTSTR pszMsg,
  26. IN LPCTSTR pszTitle,
  27. IN UINT uFlags,
  28. IN pfHelpCallback pCallBack = NULL, OPTIONAL
  29. IN PVOID RefData = NULL OPTIONAL
  30. );
  31. //
  32. // Dialog box helper class to catch the WM_HELP
  33. // message when there is a help button on
  34. // a message box.
  35. //
  36. class TMessageBoxDialog : public MGenericDialog
  37. {
  38. SIGNATURE( 'mbdb' )
  39. public:
  40. TMessageBoxDialog(
  41. IN HWND hWnd,
  42. IN UINT uFlags,
  43. IN LPCTSTR pszTitle,
  44. IN LPCTSTR pszMsg,
  45. IN pfHelpCallback pCallBack = NULL,
  46. IN PVOID RefData = NULL
  47. );
  48. ~TMessageBoxDialog(
  49. VOID
  50. );
  51. BOOL
  52. bValid(
  53. VOID
  54. ) const;
  55. INT
  56. iMessageBox(
  57. VOID
  58. );
  59. private:
  60. //
  61. // Copying and assignment are not defined.
  62. //
  63. TMessageBoxDialog(
  64. const TMessageBoxDialog &
  65. );
  66. TMessageBoxDialog &
  67. operator =(
  68. const TMessageBoxDialog &
  69. );
  70. BOOL
  71. bHandleMessage(
  72. IN UINT uMsg,
  73. IN WPARAM wParam,
  74. IN LPARAM lParam
  75. );
  76. HWND _hWnd;
  77. UINT _uFlags;
  78. LPCTSTR _pszTitle;
  79. LPCTSTR _pszMsg;
  80. INT _iRetval;
  81. PVOID _pRefData;
  82. pfHelpCallback _pCallback;
  83. };
  84. #endif