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.

63 lines
1.3 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1995-1999 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: conndlg.cpp
  6. * Content: Connect Dialog Support Routines
  7. * History:
  8. *
  9. * Date By Reason
  10. * ==== == ======
  11. * 10/15/99 rodtoll created it
  12. *
  13. ***************************************************************************/
  14. #include "dxvhelppch.h"
  15. TCHAR g_lpszAddress[_MAX_PATH] = _T("");
  16. INT_PTR CALLBACK ConnectDialog_WinProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
  17. {
  18. switch (message)
  19. {
  20. case WM_INITDIALOG:
  21. _tcscpy( g_lpszAddress, _T("localhost") );
  22. SetWindowText( GetDlgItem( hDlg, IDC_EDIT_ADDRESS), g_lpszAddress );
  23. return TRUE;
  24. case WM_COMMAND:
  25. if (LOWORD(wParam) == IDOK )
  26. {
  27. GetWindowText( GetDlgItem( hDlg, IDC_EDIT_ADDRESS), g_lpszAddress, _MAX_PATH );
  28. }
  29. if( LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
  30. {
  31. EndDialog(hDlg, LOWORD(wParam));
  32. return TRUE;
  33. }
  34. break;
  35. }
  36. return FALSE;
  37. }
  38. BOOL GetConnectSettings( HINSTANCE hInst, HWND hOwner, LPTSTR lpszAddress )
  39. {
  40. _tcscpy( g_lpszAddress, lpszAddress );
  41. if( DialogBox( hInst, MAKEINTRESOURCE( IDD_DIALOG_CONNECT ), hOwner, ConnectDialog_WinProc ) == IDOK )
  42. {
  43. _tcscpy( lpszAddress, g_lpszAddress );
  44. return TRUE;
  45. }
  46. else
  47. {
  48. return FALSE;
  49. }
  50. }