timertick.cpp
来自「嵌入式DOS系统上位升级程序FileUpgrade, 需配合本人上传的FileU」· C++ 代码 · 共 35 行
CPP
35 行
#include "stdafx.h"
#include "MessageEdit.h"
unsigned char gCharTimeout; //每55ms减少1,直到0为止
unsigned short int gIntervalTimeout; //每55ms减少1,直到0为止.
unsigned short int gSecondTimeout; //每s减少1,直到0为止.
unsigned char gCharInterval=0;//一般不能用。
static CWnd *ptrMainWnd;
static VOID CALLBACK TimerProc(HWND hwnd,UINT uMsg,UINT idEvent,DWORD dwTime)
{
static char secFCount=19;
secFCount--;
if(secFCount==0)
{
secFCount=18;
if(gSecondTimeout) gSecondTimeout--;
}
if(gCharInterval) gCharInterval--;
if(gCharTimeout) gCharTimeout--;
if(gIntervalTimeout) gIntervalTimeout--;
}
void OpenTimerTick(CWnd *ptrWnd)
{
ptrMainWnd=ptrWnd;
ptrWnd->SetTimer(3,55,TimerProc);
}
void KillTimerTick()
{
if(ptrMainWnd) ptrMainWnd->KillTimer(3);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?