animthrd.h

来自「wince下internet explorer的浏览器的简单实现」· C头文件 代码 · 共 70 行

H
70
字号
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.

Module Name:  animthrd.h

Abstract:  handles the animation thread

Functions:

Notes: This class encapsulates the thread that runs the animation


--*/

#ifndef _ANIMTHRD_H_
#define _ANIMTHRD_H_

#ifndef NOCOMMANDBAR

#define ANIMATIONINTERVAL	30

class CAnimThread
{
public:
	CAnimThread(CMainWnd *pMainWnd);
	~CAnimThread();

public:
	VOID StartThread();
	VOID StartAnimation();
	VOID StopAnimation();

private:
	DWORD Run();
	VOID Paint();
	static DWORD WINAPI AnimationThreadProc(LPVOID lpParam);
	static LRESULT CALLBACK AnimationWndProc(HWND hwnd, UINT message,
												WPARAM wParam, LPARAM lParam);

private:
	DWORD		_dwThreadID;	//the thread id
        DWORD 		_dwTimerInterval; // animation interval
	LONG 		_nIndex;		//the index of the frame in the bitmap currently being shown
	HBITMAP		_hBitmap;		//handle to the animation bitmap
	HWND		_hwndCmdband;	//the command band on which to create the animation window
	HWND		_hwndAnimation;	//the animation window
	LONG		_bRun;			//is the animation being run

	WNDPROC		_lpfnAnimationProc;

    CMainWnd    *_pMainWnd;

};

#endif	//NOCOMMANDBAR
#endif	//_ANIMTHRD_H_

⌨️ 快捷键说明

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