diff options
Diffstat (limited to 'utils/vmpi/idle_dialog.h')
| -rw-r--r-- | utils/vmpi/idle_dialog.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/utils/vmpi/idle_dialog.h b/utils/vmpi/idle_dialog.h new file mode 100644 index 0000000..5dbe20c --- /dev/null +++ b/utils/vmpi/idle_dialog.h @@ -0,0 +1,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 |