#pragma once
#include "afxcmn.h"


// CDlgDebug 对话框
extern HWND MyFindWindow(LPCTSTR lpClassName);

class CPageDebug : public CDialogEx
{
	DECLARE_DYNAMIC(CPageDebug)

public:
	CPageDebug(CWnd* pParent = NULL);   // 标准构造函数
	virtual ~CPageDebug();

// 对话框数据
	enum { IDD = PAGE_DEBUG };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持

	DECLARE_MESSAGE_MAP()
public:
	virtual BOOL OnInitDialog();
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	CListCtrl m_ctrlList;
	void InitListCtrl();
	inline void ShowOGCWnd(int nCmdShow = SW_SHOW)
	{
		HWND hWnd = NULL;
		if ( hWnd = MyFindWindow(_T("TfrmDemo")) )
			::ShowWindow(hWnd, nCmdShow);

		if ( hWnd = MyFindWindow(_T("TApplication")) )
			::ShowWindow(hWnd, nCmdShow);

		SetDlgItemText(BTN_SHOW_WND, nCmdShow == SW_SHOW ? _T("隐藏窗口") : _T("显示窗口"));
	}
	static CPageDebug *m_pDlg;
	static BOOL CALLBACK ConnectProc(DATAHEADER *pHeader, MSG_INFO *pMsg);
	static BOOL CALLBACK GoProc(DATAHEADER *pHeader, MSG_INFO *pMsg);
	afx_msg void OnBnClickedShowWnd();
	afx_msg void OnBnClickedHijack();
	afx_msg void OnBnClickedTest();
	afx_msg void OnBnClickedConnect();
	afx_msg void OnTimer(UINT_PTR nIDEvent);
};
