home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / general / vcterm / inputdlg.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-27  |  1.6 KB  |  65 lines

  1. // inputdlg.cpp : implementation of the CInputDlg class
  2. //
  3.  
  4. // This is a part of the Microsoft Foundation Classes C++ library.
  5. // Copyright (C) 1992-1998 Microsoft Corporation
  6. // All rights reserved.
  7. //
  8. // This source code is only intended as a supplement to the
  9. // Microsoft Foundation Classes Reference and related
  10. // electronic documentation provided with the library.
  11. // See these sources for detailed information regarding the
  12. // Microsoft Foundation Classes product.
  13.  
  14. #include "stdafx.h"
  15. #include "vcterm.h"
  16. #include "InputDlg.h"
  17.  
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23.  
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CInputDlg dialog
  26.  
  27.  
  28. CInputDlg::CInputDlg(CWnd* pParent)
  29.     : CDialog(CInputDlg::IDD, pParent)
  30. {
  31.     //{{AFX_DATA_INIT(CInputDlg)
  32.     m_strEdit = "";
  33.     //}}AFX_DATA_INIT
  34. }
  35.  
  36.  
  37. void CInputDlg::DoDataExchange(CDataExchange* pDX)
  38. {
  39.     CDialog::DoDataExchange(pDX);
  40.     //{{AFX_DATA_MAP(CInputDlg)
  41.     DDX_Text(pDX, IDC_EDIT1, m_strEdit);
  42.     //}}AFX_DATA_MAP
  43. }
  44.  
  45.  
  46. BEGIN_MESSAGE_MAP(CInputDlg, CDialog)
  47.     //{{AFX_MSG_MAP(CInputDlg)
  48.     //}}AFX_MSG_MAP
  49. END_MESSAGE_MAP()
  50.  
  51. /////////////////////////////////////////////////////////////////////////////
  52. // CInputDlg message handlers
  53.  
  54. BOOL CInputDlg::OnInitDialog()
  55. {
  56.     CDialog::OnInitDialog();
  57.  
  58.     GetDlgItem(IDC_STATIC1)->SetWindowText(m_strPrompt);
  59.     ((CEdit*)GetDlgItem(IDC_EDIT1))->SetSel(0,-1);
  60.     GetDlgItem(IDC_EDIT1)->SetFocus();
  61.  
  62.     return FALSE; // return TRUE unless you set the focus to a control
  63.                   // EXCEPTION: OCX Property Pages should return FALSE
  64. }
  65.