summaryrefslogtreecommitdiff
path: root/utils/vmpi/idle_dialog.h
blob: 5dbe20c8414289ca7780abf54f53d10b30a11fa2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================//

#ifndef IDLE_DIALOG_H
#define IDLE_DIALOG_H
#ifdef _WIN32
#pragma once
#endif


#include "win_idle.h"


//
// This is a base class that provides in-thread idle processing.
//
// To use it:
// 1. derive from it
// 2. Change your message map to point at this class instead of CDialog
// 3. Call StartIdleProcessing to begin receiving idle calls.
// 4. Override OnIdle().
//

class CIdleDialog : public CDialog
{
public:
					
					CIdleDialog( int id, CWnd *pParent );
	
	// Call this to start the idle processing.
	void			StartIdleProcessing( DWORD msInterval );
	
	virtual void	OnIdle() = 0;


private:
	DECLARE_MESSAGE_MAP()
	afx_msg LONG OnStartIdle(UINT, LONG);

	CWinIdle m_cWinIdle;
};


#endif // IDLE_DIALOG_H