home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of Windows 95.com 1996 September
/
WIN95_09963.iso
/
strategy
/
hangman.zip
/
Hangman32.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1996-01-15
|
2KB
|
88 lines
// Hangman32.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "Hangman32.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CHangman32App
BEGIN_MESSAGE_MAP(CHangman32App, CWinApp)
//{{AFX_MSG_MAP(CHangman32App)
//}}AFX_MSG_MAP
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CHangman32App construction
CHangman32App::CHangman32App()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
m_doAccel = TRUE; // Initialize boolean to process Accel Table
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CHangman32App object
CHangman32App theApp;
/////////////////////////////////////////////////////////////////////////////
// CHangman32App initialization
BOOL CHangman32App::InitInstance()
{
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
CHangman32Dlg dlg;
m_hwndDialog = NULL;
m_pMainWnd = &dlg;
m_AccelTable = LoadAccelerators(AfxGetInstanceHandle(),
MAKEINTRESOURCE(IDR_ACCELERATOR1));
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
BOOL CHangman32App::ProcessMessageFilter(int code, LPMSG lpMsg)
{
if(code < 0)
CWinApp::ProcessMessageFilter(code, lpMsg);
if( m_hwndDialog && m_AccelTable && m_doAccel )
{
if(::TranslateAccelerator(m_hwndDialog, m_AccelTable, lpMsg))
return(TRUE);
}
return CWinApp::ProcessMessageFilter(code, lpMsg);
}