// ProcessTimeDlg.h : header file
//  Author : YogaRamanan.T

#if !defined(AFX_PROCESSTIMEDLG_H__C7EB8F8E_9520_4BF0_B926_5A9D88BD5307__INCLUDED_)
#define AFX_PROCESSTIMEDLG_H__C7EB8F8E_9520_4BF0_B926_5A9D88BD5307__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CProcessTimeDlg dialog

class CProcessTimeDlg : public CDialog
{
// Construction
public:
	CProcessTimeDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CProcessTimeDlg)
	enum { IDD = IDD_PROCESSTIME_DIALOG };
		// NOTE: the ClassWizard will add data members here
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CProcessTimeDlg)
	public:
	virtual BOOL DestroyWindow();
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	void ClearProcessList();
	HICON m_hIcon;

	void AddProcessToList(DWORD processID);
	void UpdateProcessList();
	void UpdateDriverList();
	void UpdateProcessTime();

	struct ST_PROCESSINFO
	{
		DWORD dwProcessId;
		HANDLE hProcess;

		ST_PROCESSINFO()
		{
			dwProcessId = 0;
			hProcess = NULL;
		}

		~ST_PROCESSINFO()
		{
			dwProcessId = 0;

			if(hProcess)
				CloseHandle(hProcess);
			hProcess = NULL;
		}
	};

	bool m_bStopUpdateProcessThread;
	HANDLE m_hUpdateProcessThread;
	static DWORD WINAPI UpdateProcessThread(void *lpVoid);


	// Generated message map functions
	//{{AFX_MSG(CProcessTimeDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnBtnProcessClear();
	afx_msg void OnBtnDriversClear();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_PROCESSTIMEDLG_H__C7EB8F8E_9520_4BF0_B926_5A9D88BD5307__INCLUDED_)
