xref: /freebsd/crypto/krb5/src/windows/leash/LeashMessageBox.cpp (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1*7f2fe78bSCy Schubert //	**************************************************************************************
2*7f2fe78bSCy Schubert //	File:			LeashMessageBox.cpp
3*7f2fe78bSCy Schubert //	By:				Arthur David Leather
4*7f2fe78bSCy Schubert //	Created:		12/02/98
5*7f2fe78bSCy Schubert //	Copyright		@1998 Massachusetts Institute of Technology - All rights reserved.
6*7f2fe78bSCy Schubert //	Description:    CPP file for LeashMessageBox.h. Contains variables and functions
7*7f2fe78bSCy Schubert //					for the Leash Special Message Dialog Box
8*7f2fe78bSCy Schubert //
9*7f2fe78bSCy Schubert //	History:
10*7f2fe78bSCy Schubert //
11*7f2fe78bSCy Schubert //	MM/DD/YY	Inits	Description of Change
12*7f2fe78bSCy Schubert //	12/02/98	ADL		Original
13*7f2fe78bSCy Schubert //	**************************************************************************************
14*7f2fe78bSCy Schubert 
15*7f2fe78bSCy Schubert 
16*7f2fe78bSCy Schubert 
17*7f2fe78bSCy Schubert #include "stdafx.h"
18*7f2fe78bSCy Schubert #include "leash.h"
19*7f2fe78bSCy Schubert #include "LeashMessageBox.h"
20*7f2fe78bSCy Schubert 
21*7f2fe78bSCy Schubert #ifdef _DEBUG
22*7f2fe78bSCy Schubert #define new DEBUG_NEW
23*7f2fe78bSCy Schubert #undef THIS_FILE
24*7f2fe78bSCy Schubert static char THIS_FILE[] = __FILE__;
25*7f2fe78bSCy Schubert #endif
26*7f2fe78bSCy Schubert 
27*7f2fe78bSCy Schubert DWORD CLeashMessageBox ::m_dwTime;
28*7f2fe78bSCy Schubert 
29*7f2fe78bSCy Schubert /////////////////////////////////////////////////////////////////////////////
30*7f2fe78bSCy Schubert // CLeashMessageBox dialog
31*7f2fe78bSCy Schubert 
CLeashMessageBox(CWnd * pParent,const CString msgText,DWORD dwTime)32*7f2fe78bSCy Schubert CLeashMessageBox::CLeashMessageBox(CWnd* pParent, const CString msgText, DWORD dwTime)
33*7f2fe78bSCy Schubert 	: CDialog(CLeashMessageBox::IDD, pParent)
34*7f2fe78bSCy Schubert {
35*7f2fe78bSCy Schubert 	m_dwTime = dwTime;
36*7f2fe78bSCy Schubert 
37*7f2fe78bSCy Schubert 	//{{AFX_DATA_INIT(CLeashMessageBox)
38*7f2fe78bSCy Schubert 	m_messageText = _T(msgText);
39*7f2fe78bSCy Schubert 	//}}AFX_DATA_INIT
40*7f2fe78bSCy Schubert }
41*7f2fe78bSCy Schubert 
~CLeashMessageBox()42*7f2fe78bSCy Schubert CLeashMessageBox::~CLeashMessageBox()
43*7f2fe78bSCy Schubert {
44*7f2fe78bSCy Schubert }
45*7f2fe78bSCy Schubert 
DoDataExchange(CDataExchange * pDX)46*7f2fe78bSCy Schubert void CLeashMessageBox::DoDataExchange(CDataExchange* pDX)
47*7f2fe78bSCy Schubert {
48*7f2fe78bSCy Schubert 	CDialog::DoDataExchange(pDX);
49*7f2fe78bSCy Schubert 	//{{AFX_DATA_MAP(CLeashMessageBox)
50*7f2fe78bSCy Schubert 	DDX_Text(pDX, IDC_LEASH_WARNING_MSG, m_messageText);
51*7f2fe78bSCy Schubert 	//}}AFX_DATA_MAP
52*7f2fe78bSCy Schubert }
53*7f2fe78bSCy Schubert 
54*7f2fe78bSCy Schubert 
BEGIN_MESSAGE_MAP(CLeashMessageBox,CDialog)55*7f2fe78bSCy Schubert BEGIN_MESSAGE_MAP(CLeashMessageBox, CDialog)
56*7f2fe78bSCy Schubert 	//{{AFX_MSG_MAP(CLeashMessageBox)
57*7f2fe78bSCy Schubert 	ON_WM_DESTROY()
58*7f2fe78bSCy Schubert 	//}}AFX_MSG_MAP
59*7f2fe78bSCy Schubert END_MESSAGE_MAP()
60*7f2fe78bSCy Schubert 
61*7f2fe78bSCy Schubert /////////////////////////////////////////////////////////////////////////////
62*7f2fe78bSCy Schubert // CLeashMessageBox message handlers
63*7f2fe78bSCy Schubert 
64*7f2fe78bSCy Schubert void CALLBACK CLeashMessageBox::MessageBoxTimer(HWND hwnd, UINT uiMsg, UINT_PTR idEvent, DWORD dwTime)
65*7f2fe78bSCy Schubert {
66*7f2fe78bSCy Schubert 	::KillTimer(hwnd, 2);
67*7f2fe78bSCy Schubert 	::SendMessage(hwnd, WM_CLOSE, 0, 0);
68*7f2fe78bSCy Schubert }
69*7f2fe78bSCy Schubert 
OnOK()70*7f2fe78bSCy Schubert void CLeashMessageBox::OnOK()
71*7f2fe78bSCy Schubert {
72*7f2fe78bSCy Schubert 	KillTimer(2);
73*7f2fe78bSCy Schubert     SendMessage(WM_CLOSE, 0, 0);
74*7f2fe78bSCy Schubert }
75*7f2fe78bSCy Schubert 
OnInitDialog()76*7f2fe78bSCy Schubert BOOL CLeashMessageBox::OnInitDialog()
77*7f2fe78bSCy Schubert {
78*7f2fe78bSCy Schubert 	CDialog::OnInitDialog();
79*7f2fe78bSCy Schubert 	UINT_PTR idTimer = SetTimer(2, m_dwTime, &MessageBoxTimer);
80*7f2fe78bSCy Schubert 
81*7f2fe78bSCy Schubert 	return TRUE;  // return TRUE unless you set the focus to a control
82*7f2fe78bSCy Schubert 	              // EXCEPTION: OCX Property Pages should return FALSE
83*7f2fe78bSCy Schubert }
84