traytest.cpp

来自「Visual C++下的界面设计」· C++ 代码 · 共 52 行

CPP
52
字号
#include "stdafx.h"
#include "traytest.h"
#include "MainFrm.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

BEGIN_MESSAGE_MAP(CTrayApp, CWinApp)
	//{{AFX_MSG_MAP(CTrayApp)
	ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

CTrayApp::CTrayApp()
{
  bDisplayingAboutBox = FALSE;
}

CTrayApp theApp;

BOOL CTrayApp::InitInstance()
{
	Enable3dControls();

  CMainFrame* pMainFrame = new CMainFrame;
  m_pMainWnd = pMainFrame;
  if (!pMainFrame->Create(NULL, _T("Traytest")))
    return FALSE;

  m_pMainWnd->ShowWindow(SW_HIDE);
  m_pMainWnd->UpdateWindow();
  OnAppAbout();

	return TRUE;
}


void CTrayApp::OnAppAbout()
{
  //avoid bringing up two versions of the dialog
  if (bDisplayingAboutBox)
    return;

  bDisplayingAboutBox = TRUE;
	CDialog(IDD_ABOUTBOX).DoModal();
  bDisplayingAboutBox = FALSE;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?