在下面的代码里怎么找不到KillTimer,那怎么释放定时器?// SplashWnd.cpp : 实现文件
//
// ?998-2001 Codejock Software, All Rights Reserved.
// Based on the Visual C++ splash screen component.
//
// [email protected]
// http://www.codejock.com
//
//////////////////////////////////////////////////////////////////////#include "stdafx.h"
#include "SplashWnd.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
//   Splash Screen 类BOOL        CSplashWnd::m_bShowSplashWnd;
CSplashWnd* CSplashWnd::m_pSplashWnd;// 构造函数
CSplashWnd::CSplashWnd()
{
}// 析构函数
CSplashWnd::~CSplashWnd()
{
// 清除窗口文本指针
ASSERT(m_pSplashWnd == this);
m_pSplashWnd = NULL;
}// 消息映射
BEGIN_MESSAGE_MAP(CSplashWnd, CWnd)
//{{AFX_MSG_MAP(CSplashWnd)
ON_WM_PAINT()
ON_WM_TIMER()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()// 使程序能够显示 Splash Screen 组件
void CSplashWnd::EnableSplashScreen(BOOL bEnable /*= TRUE*/)
{
m_bShowSplashWnd = bEnable;
}// 显示 Splash Screen 组件
BOOL CSplashWnd::ShowSplashScreen(UINT uTimeOut, UINT uBitmapID, CWnd* pParentWnd /*= NULL*/)
{
ASSERT(uTimeOut && uBitmapID);

if (!m_bShowSplashWnd || m_pSplashWnd != NULL) {
return FALSE;
} // 分配一个新的Splash Screen 组件,创建窗口
m_pSplashWnd = new CSplashWnd; if (!m_pSplashWnd->m_bitmap.LoadBitmap(uBitmapID)) {
return FALSE;
} BITMAP bm;
m_pSplashWnd->m_bitmap.GetBitmap(&bm); CString strWndClass = AfxRegisterWndClass(0,
AfxGetApp()->LoadStandardCursor(IDC_ARROW)); if (!m_pSplashWnd->CreateEx(0, strWndClass, NULL, WS_POPUP | WS_VISIBLE,
0, 0, bm.bmWidth, bm.bmHeight, pParentWnd->GetSafeHwnd(), NULL))
{
TRACE0("创建 splash 窗体失败!\n");
delete m_pSplashWnd;
return FALSE;
} // 使窗口居中
m_pSplashWnd->CenterWindow();
m_pSplashWnd->UpdateWindow(); // 设置定时器以释放 Splash Screen 组件
m_pSplashWnd->SetTimer(1, uTimeOut, NULL); return TRUE;
}BOOL CSplashWnd::PreTranslateAppMessage(MSG* pMsg)
{
if (m_pSplashWnd == NULL)
return FALSE; // 获得键盘或鼠标信息时,隐藏 Splash Screen
if (pMsg->message == WM_KEYDOWN ||
    pMsg->message == WM_SYSKEYDOWN ||
    pMsg->message == WM_LBUTTONDOWN ||
    pMsg->message == WM_RBUTTONDOWN ||
    pMsg->message == WM_MBUTTONDOWN ||
    pMsg->message == WM_NCLBUTTONDOWN ||
    pMsg->message == WM_NCRBUTTONDOWN ||
    pMsg->message == WM_NCMBUTTONDOWN)
{
m_pSplashWnd->HideSplashScreen();
return TRUE; // 消息处理
} return FALSE; // 消息未处理
}// 隐藏 Splash Screen
void CSplashWnd::HideSplashScreen()
{
// 窗口消息,更新文档
DestroyWindow();
AfxGetMainWnd()->UpdateWindow();
}void CSplashWnd::PostNcDestroy()
{
// 释放 C++ 类指针
delete this;
}// 绘制函数
void CSplashWnd::OnPaint()
{
CPaintDC dc(this); CDC dcImage;
if (dcImage.CreateCompatibleDC(&dc))
{
BITMAP bm;
m_bitmap.GetBitmap(&bm); // 绘制图形
CBitmap* pOldBitmap = dcImage.SelectObject(&m_bitmap);
dc.BitBlt(0, 0, bm.bmWidth, bm.bmHeight, &dcImage, 0, 0, SRCCOPY);
dcImage.SelectObject(pOldBitmap);
}
}void CSplashWnd::OnTimer(UINT nIDEvent)
{
// 释放 splash screen
HideSplashScreen();
}