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.

191 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 1994-1998 Microsoft Corporation
  3. Module Name :
  4. connects.cpp
  5. Abstract:
  6. "Connect to a single server" dialog
  7. Author:
  8. Ronald Meijer (ronaldm)
  9. Project:
  10. Internet Services Manager
  11. Functions Exported:
  12. Revision History:
  13. --*/
  14. //
  15. // Include files
  16. //
  17. #include "stdafx.h"
  18. #include "inetmgr.h"
  19. #include "connects.h"
  20. #include "constr.h"
  21. #ifdef _DEBUG
  22. #undef THIS_FILE
  23. static char BASED_CODE THIS_FILE[] = __FILE__;
  24. #endif
  25. #define HIDD_CONNECT_SERVER 0x29cd9
  26. ConnectServerDlg::ConnectServerDlg(
  27. IN CWnd * pParent OPTIONAL
  28. )
  29. /*++
  30. Routine Description:
  31. Constructor
  32. Arguments:
  33. CWnd * pParent : Optional pointer to parent window
  34. Return Value:
  35. N/A
  36. --*/
  37. : CDialog(ConnectServerDlg::IDD, pParent)
  38. {
  39. //{{AFX_DATA_INIT(ConnectServerDlg)
  40. m_strServerName = _T("");
  41. //}}AFX_DATA_INIT
  42. }
  43. void
  44. ConnectServerDlg::DoDataExchange(
  45. IN CDataExchange * pDX
  46. )
  47. /*++
  48. Routine Description:
  49. Initialise/Store control data
  50. Arguments:
  51. CDataExchange * pDX - DDX/DDV control structure
  52. Return Value:
  53. None
  54. --*/
  55. {
  56. CDialog::DoDataExchange(pDX);
  57. //{{AFX_DATA_MAP(ConnectServerDlg)
  58. DDX_Control(pDX, IDC_SERVERNAME, m_edit_ServerName);
  59. DDX_Control(pDX, IDOK, m_button_Ok);
  60. //}}AFX_DATA_MAP
  61. DDX_Text(pDX, IDC_SERVERNAME, m_strServerName);
  62. DDV_MaxChars(pDX, m_strServerName, MAX_SERVERNAME_LEN);
  63. }
  64. //
  65. // Message Map
  66. //
  67. BEGIN_MESSAGE_MAP(ConnectServerDlg, CDialog)
  68. //{{AFX_MSG_MAP(ConnectServerDlg)
  69. ON_EN_CHANGE(IDC_SERVERNAME, OnChangeServername)
  70. ON_BN_CLICKED(ID_HELP, OnHelp)
  71. //}}AFX_MSG_MAP
  72. END_MESSAGE_MAP()
  73. //
  74. // Message Handlers
  75. //
  76. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  77. void
  78. ConnectServerDlg::OnHelp()
  79. {
  80. CString strHelpFile;
  81. CRMCRegKey rk(REG_KEY, SZ_PARAMETERS, KEY_READ);
  82. rk.QueryValue(SZ_HELPPATH, strHelpFile, EXPANSION_ON);
  83. strHelpFile += _T("\\inetmgr.hlp");
  84. CWnd * pWnd = ::AfxGetMainWnd();
  85. HWND hWndParent = pWnd != NULL
  86. ? pWnd->m_hWnd
  87. : NULL;
  88. ::WinHelp(m_hWnd, strHelpFile, HELP_CONTEXT, HIDD_CONNECT_SERVER);
  89. }
  90. void
  91. ConnectServerDlg::OnChangeServername()
  92. /*++
  93. Routine Description:
  94. Respond to change of text in the server edit control
  95. by enabling or disabling the OK button depending on
  96. whether there's any text in the server name edit
  97. control.
  98. Arguments:
  99. None
  100. Return Value:
  101. None
  102. --*/
  103. {
  104. m_button_Ok.EnableWindow(m_edit_ServerName.GetWindowTextLength() > 0);
  105. }
  106. BOOL
  107. ConnectServerDlg::OnInitDialog()
  108. /*++
  109. Routine Description:
  110. WM_INITDIALOG handler. Initialize the dialog.
  111. Arguments:
  112. None.
  113. Return Value:
  114. TRUE if no focus is to be set automatically, FALSE if the focus
  115. is already set.
  116. --*/
  117. {
  118. CDialog::OnInitDialog();
  119. //
  120. // No server name has been entered yet.
  121. //
  122. m_button_Ok.EnableWindow(FALSE);
  123. return TRUE;
  124. }