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.

41 lines
1.1 KiB

  1. //////////////////////////////////////////////////////////////
  2. //
  3. // NewDomainDlg.cpp
  4. //
  5. // Implementation of the "Add Domain" dialog
  6. //
  7. //////////////////////////////////////////////////////////////
  8. #include "stdafx.h"
  9. #include "NewDomainDlg.h"
  10. LRESULT CNewDomainDlg::OnInitDialog( UINT mMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled )
  11. {
  12. Prefix_EnableWindow( m_hWnd, IDOK, FALSE );
  13. SendDlgItemMessage( IDC_DOMAIN_NAME, EM_LIMITTEXT, 255, 0 );
  14. HWND hWndDomain = GetDlgItem(IDC_DOMAIN_NAME);
  15. if( hWndDomain && ::IsWindow(hWndDomain) )
  16. {
  17. m_wndDomainName.SubclassWindow( hWndDomain );
  18. }
  19. return 0;
  20. }
  21. LRESULT CNewDomainDlg::OnEditChange( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled )
  22. {
  23. // Check for Domain Name length
  24. int nLen = SendDlgItemMessage( IDC_DOMAIN_NAME, WM_GETTEXTLENGTH );
  25. Prefix_EnableWindow( m_hWnd, IDOK, (nLen > 0) );
  26. return 0;
  27. }
  28. LRESULT CNewDomainDlg::OnClose( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled )
  29. {
  30. StrGetEditText( m_hWnd, IDC_DOMAIN_NAME, m_strName );
  31. EndDialog(wID);
  32. return 0;
  33. }