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.

90 lines
2.1 KiB

  1. //=============================================================================*
  2. // COPYRIGHT� 2001 Microsoft Corporation and Executive Software International, Inc.
  3. //=============================================================================*
  4. // File: MIMessage.cpp
  5. //=============================================================================*
  6. #include "stdafx.h"
  7. #ifndef SNAPIN
  8. #ifndef NOWINDOWSH
  9. #include <windows.h>
  10. #endif
  11. #endif
  12. // from the c++ library
  13. #include "vString.hpp"
  14. #include "vPtrArray.hpp"
  15. #include <htmlhelp.h>
  16. #include "resource.h"
  17. #include "GetDfrgRes.h"
  18. #include "errmacro.h"
  19. #include "MIMessage.h"
  20. VString GetDialogBoxTextMultiple();
  21. #include "genericdialog.h"
  22. //-------------------------------------------------------------------*
  23. // function: RaiseMIDialog
  24. //
  25. // returns: None
  26. // note:
  27. //-------------------------------------------------------------------*
  28. BOOL RaiseMIDialog(HWND hWndDialog)
  29. {
  30. VString dlgString;
  31. UINT iWhichKeyPressed = NULL;
  32. CGenericDialog* genericdialog = new CGenericDialog();
  33. if (!genericdialog) {
  34. return FALSE;
  35. }
  36. genericdialog->SetTitle(IDS_DK_TITLE);
  37. //close button 0
  38. genericdialog->SetButtonText(0,IDS_MI_HELP);
  39. //defrag button 1
  40. genericdialog->SetButtonText(1,IDS_OK);
  41. //get the string displayed in the dialog
  42. dlgString += GetDialogBoxTextMultiple();
  43. genericdialog->SetText(dlgString.GetBuffer());
  44. //set the icon status
  45. genericdialog->SetIcon(IDI_CRITICAL_ICON);
  46. iWhichKeyPressed = genericdialog->DoModal(hWndDialog);
  47. delete genericdialog;
  48. switch(iWhichKeyPressed) {
  49. case 0:
  50. HtmlHelp(
  51. hWndDialog,
  52. TEXT("dkconcepts.chm::/defrag_overview_01.htm"),
  53. HH_DISPLAY_TOPIC, //HH_TP_HELP_CONTEXTMENU,
  54. NULL); //(DWORD)(LPVOID)myarray);
  55. break;
  56. case 1:
  57. break;
  58. default:
  59. return FALSE;
  60. }
  61. return TRUE;
  62. }
  63. VString GetDialogBoxTextMultiple()
  64. {
  65. // write the Analysis Complete text in the dialog
  66. VString dlgText(IDS_MULTI_INSTANCE_1, GetDfrgResHandle());
  67. return(dlgText);
  68. }