maindlg.cpp

来自「这是一套学校设备管理系统的源码 里面有树形结构使用的很棒的方法」· C++ 代码 · 共 82 行

CPP
82
字号
// maindlg.cpp : implementation file
//

#include "stdafx.h"
#include "xxgl.h"
#include "maindlg.h"
#include "process.h"
#include "strt.h"
#include "ext.h"
#include "func.h"

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

Cmaindlg::Cmaindlg(CWnd* pParent /*=NULL*/)
	: CDialog(Cmaindlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(Cmaindlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void Cmaindlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(Cmaindlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(Cmaindlg, CDialog)
	//{{AFX_MSG_MAP(Cmaindlg)
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// Cmaindlg message handlers
static int first_flag=0;
static int old_sec;
void Cmaindlg::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	
	// TODO: Add your message handler code here
	
	// Do not call CDialog::OnPaint() for painting messages
}

LRESULT Cmaindlg::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam) 
{
	// TODO: Add your specialized code here and/or call the base class
	
    time_t ltime;    
	struct tm *pti;
	int sec;

    time(&ltime);    
	pti = gmtime(&ltime);
	sec = pti->tm_sec;
	if (first_flag == 0){
		first_flag = 1;
		old_sec = sec;
    }
	if (old_sec != sec){
		if (first_flag == 1){
	      EndDialog(1);
          first_flag = 2;
		  old_sec = sec;
		}
		else{
	      EndDialog(1);
        }
    }
	return CDialog::DefWindowProc(message, wParam, lParam);
}

⌨️ 快捷键说明

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