1
// Log_Msg_MFCDlg.cpp : implementation file
2
// Log_Msg_MFCDlg.cpp,v 1.3 2003/11/01 11:15:23 dhinton Exp
4
#include "Log_Msg_MFC.h"
6
#if defined (ACE_WIN32)
9
#include "Log_Msg_MFCDlg.h"
14
static char THIS_FILE[] = __FILE__;
19
/////////////////////////////////////////////////////////////////////////////
20
// CAboutDlg dialog used for App About
22
class CAboutDlg : public CDialog
28
//{{AFX_DATA(CAboutDlg)
29
enum { IDD = IDD_ABOUTBOX };
32
// ClassWizard generated virtual function overrides
33
//{{AFX_VIRTUAL(CAboutDlg)
35
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
40
//{{AFX_MSG(CAboutDlg)
45
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
47
//{{AFX_DATA_INIT(CAboutDlg)
51
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
53
CDialog::DoDataExchange(pDX);
54
//{{AFX_DATA_MAP(CAboutDlg)
58
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
59
//{{AFX_MSG_MAP(CAboutDlg)
60
// No message handlers
64
/////////////////////////////////////////////////////////////////////////////
65
// CLog_Msg_MFCDlg dialog
67
CLog_Msg_MFCDlg::CLog_Msg_MFCDlg(CWnd* pParent /*=NULL*/)
68
: CDialog(CLog_Msg_MFCDlg::IDD, pParent)
70
//{{AFX_DATA_INIT(CLog_Msg_MFCDlg)
71
// NOTE: the ClassWizard will add member initialization here
73
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
74
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
77
void CLog_Msg_MFCDlg::DoDataExchange(CDataExchange* pDX)
79
CDialog::DoDataExchange(pDX);
80
//{{AFX_DATA_MAP(CLog_Msg_MFCDlg)
81
// NOTE: the ClassWizard will add DDX and DDV calls here
85
BEGIN_MESSAGE_MAP(CLog_Msg_MFCDlg, CDialog)
86
//{{AFX_MSG_MAP(CLog_Msg_MFCDlg)
90
ON_BN_CLICKED(IDC_BUTTON1, OnDebugButtonClicked)
95
/////////////////////////////////////////////////////////////////////////////
96
// CLog_Msg_MFCDlg message handlers
98
BOOL CLog_Msg_MFCDlg::OnInitDialog()
100
CDialog::OnInitDialog();
103
// Add "About..." menu item to system menu.
105
// IDM_ABOUTBOX must be in the system command range.
106
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
107
ASSERT(IDM_ABOUTBOX < 0xF000);
109
CMenu* pSysMenu = GetSystemMenu(FALSE);
110
if (pSysMenu != NULL)
112
CString strAboutMenu;
113
strAboutMenu.LoadString(IDS_ABOUTBOX);
114
if (!strAboutMenu.IsEmpty())
116
pSysMenu->AppendMenu(MF_SEPARATOR);
117
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
121
// Set the icon for this dialog. The framework does this automatically
122
// when the application's main window is not a dialog
123
SetIcon(m_hIcon, TRUE); // Set big icon
124
SetIcon(m_hIcon, FALSE); // Set small icon
126
// TODO: Add extra initialization here
128
return TRUE; // return TRUE unless you set the focus to a control
131
void CLog_Msg_MFCDlg::OnSysCommand(UINT nID, LPARAM lParam)
133
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
140
CDialog::OnSysCommand(nID, lParam);
144
// If you add a minimize button to your dialog, you will need the code below
145
// to draw the icon. For MFC applications using the document/view model,
146
// this is automatically done for you by the framework.
148
void CLog_Msg_MFCDlg::OnPaint()
152
CPaintDC dc(this); // device context for painting
154
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
156
// Center icon in client rectangle
157
int cxIcon = GetSystemMetrics(SM_CXICON);
158
int cyIcon = GetSystemMetrics(SM_CYICON);
160
GetClientRect(&rect);
161
int x = (rect.Width() - cxIcon + 1) / 2;
162
int y = (rect.Height() - cyIcon + 1) / 2;
165
dc.DrawIcon(x, y, m_hIcon);
173
// The system calls this to obtain the cursor to display while the user drags
174
// the minimized window.
175
HCURSOR CLog_Msg_MFCDlg::OnQueryDragIcon()
177
return (HCURSOR) m_hIcon;
180
void CLog_Msg_MFCDlg::OnDebugButtonClicked()
182
ACE_DEBUG(( LM_DEBUG, "Debug message sent!\n" ));
186
#endif /* ACE_WIN32 */