Discussion:
Tracking the idle state.
(too old to reply)
JoDeGr8
2009-12-14 09:48:57 UTC
Permalink
Hi,
What is the best way to track the idle state of a dialog without using
timers?

Thanks,
J
Alex Blekhman
2009-12-14 17:06:38 UTC
Permalink
Post by JoDeGr8
What is the best way to track the idle state of a dialog without
using timers?
See in MSDN documentation for WM_ENTERIDLE notification.

HTH
Alex
John H.
2009-12-18 00:07:03 UTC
Permalink
Post by JoDeGr8
Hi,
What is the best way to track the idle state of a dialog without using
timers?
Thanks,
J
If you are looking for something closer to the dialog level, you might
consider WM_KICKIDLE. An example (assuming you have a dialog template
resource IDD_DIALOG1):

#include <afxpriv.h>

class CTestDlg : public CDialog
{
public:
CTestDlg() : CDialog(IDD_DIALOG1) { }
private:
afx_msg LRESULT OnKickIdle(WPARAM, LPARAM);
DECLARE_MESSAGE_MAP()
};

BEGIN_MESSAGE_MAP(CTestDlg, CDialog)
ON_MESSAGE(WM_KICKIDLE, OnKickIdle)
END_MESSAGE_MAP()

LRESULT CTestDlg::OnKickIdle(WPARAM, LPARAM lCount)
{
// do stuff here
return TRUE;
}

Continue reading on narkive:
Loading...