Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
852 B

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "stdafx.h"
  8. #include "idle_dialog.h"
  9. #define WM_STARTIDLE (WM_USER + 565)
  10. BEGIN_MESSAGE_MAP(CIdleDialog, CDialog)
  11. //{{AFX_MSG_MAP(CVMPIBrowserDlg)
  12. ON_MESSAGE(WM_STARTIDLE, OnStartIdle)
  13. //}}AFX_MSG_MAP
  14. END_MESSAGE_MAP()
  15. CIdleDialog::CIdleDialog( int id, CWnd *pParent )
  16. : CDialog( id, pParent )
  17. {
  18. }
  19. void CIdleDialog::StartIdleProcessing( DWORD msInterval )
  20. {
  21. m_cWinIdle.StartIdle( GetSafeHwnd(), WM_STARTIDLE, 0, 0, msInterval );
  22. m_cWinIdle.NextIdle();
  23. }
  24. LONG CIdleDialog::OnStartIdle( UINT, LONG )
  25. {
  26. MSG msg;
  27. if ( !PeekMessage( &msg, GetSafeHwnd(), 0,0, PM_NOREMOVE ) )
  28. OnIdle();
  29. m_cWinIdle.NextIdle();
  30. return 0;
  31. }