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.

81 lines
2.1 KiB

  1. // AutoStartDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "msconfig.h"
  5. #include "AutoStartDlg.h"
  6. #include "MSConfigState.h"
  7. #include <htmlhelp.h>
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CAutoStartDlg dialog
  15. CAutoStartDlg::CAutoStartDlg(CWnd* pParent /*=NULL*/)
  16. : CDialog(CAutoStartDlg::IDD, pParent)
  17. {
  18. //{{AFX_DATA_INIT(CAutoStartDlg)
  19. m_checkDontShow = FALSE;
  20. //}}AFX_DATA_INIT
  21. }
  22. void CAutoStartDlg::DoDataExchange(CDataExchange* pDX)
  23. {
  24. CDialog::DoDataExchange(pDX);
  25. //{{AFX_DATA_MAP(CAutoStartDlg)
  26. DDX_Check(pDX, IDC_CHECKDONTSHOW, m_checkDontShow);
  27. //}}AFX_DATA_MAP
  28. }
  29. //-----------------------------------------------------------------------------
  30. // Catch the help messages to show the MSConfig help file.
  31. //-----------------------------------------------------------------------------
  32. BOOL CAutoStartDlg::OnHelpInfo(HELPINFO * pHelpInfo)
  33. {
  34. TCHAR szHelpPath[MAX_PATH];
  35. // Try to find a localized help file to open (bug 460691). It should be
  36. // located in %windir%\help\mui\<LANGID>.
  37. if (::ExpandEnvironmentStrings(_T("%SystemRoot%\\help\\mui"), szHelpPath, MAX_PATH))
  38. {
  39. CString strLanguageIDPath;
  40. LANGID langid = GetUserDefaultUILanguage();
  41. strLanguageIDPath.Format(_T("%s\\%04x\\msconfig.chm"), szHelpPath, langid);
  42. if (FileExists(strLanguageIDPath))
  43. {
  44. ::HtmlHelp(::GetDesktopWindow(), strLanguageIDPath, HH_DISPLAY_TOPIC, 0);
  45. return TRUE;
  46. }
  47. }
  48. if (::ExpandEnvironmentStrings(_T("%windir%\\help\\msconfig.chm"), szHelpPath, MAX_PATH))
  49. ::HtmlHelp(::GetDesktopWindow(), szHelpPath, HH_DISPLAY_TOPIC, 0);
  50. return TRUE;
  51. }
  52. void CAutoStartDlg::OnHelp()
  53. {
  54. OnHelpInfo(NULL);
  55. }
  56. BEGIN_MESSAGE_MAP(CAutoStartDlg, CDialog)
  57. //{{AFX_MSG_MAP(CAutoStartDlg)
  58. // NOTE: the ClassWizard will add message map macros here
  59. ON_WM_HELPINFO()
  60. ON_COMMAND(ID_HELP, OnHelp)
  61. //}}AFX_MSG_MAP
  62. END_MESSAGE_MAP()
  63. /////////////////////////////////////////////////////////////////////////////
  64. // CAutoStartDlg message handlers