⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 synchronizedlg.h

📁 《Visual C++.NET MFC类库应用详解》程序实例
💻 H
字号:
// SynchronizeDlg.h : 头文件
//

#pragma once

class CSynchronizeDlg;

class CCounterThread : public CWinThread
{
	DECLARE_DYNCREATE(CCounterThread)
protected:
	CCounterThread();  

// 操作
public:
	CSynchronizeDlg* m_pOwner;

// 实现
public:
	virtual ~CCounterThread();
	virtual BOOL InitInstance();
	virtual int Run();

	DECLARE_MESSAGE_MAP()
};

class CDisplayThread : public CWinThread
{
	DECLARE_DYNCREATE(CDisplayThread)
protected:
	CDisplayThread();

// 操作
public:
	CSynchronizeDlg* m_pOwner;

// 实现
public:
	virtual ~CDisplayThread();
	virtual BOOL InitInstance();
	virtual int Run();

	DECLARE_MESSAGE_MAP()
};


// CSynchronizeDlg 对话框
class CSynchronizeDlg : public CDialog
{
// 构造
public:
	CSynchronizeDlg(CWnd* pParent = NULL);	// 标准构造函数

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

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

public:
	CString m_strNumber;
    CEvent m_SyncObj;
//	CMutex m_SyncObj;
//	CCriticalSection m_SyncObj;
//	CSemaphore m_SyncObj;
	CCounterThread* m_pCounterThread;
	CDisplayThread* m_pDisplayThread;
	void AddToListBox(LPCTSTR szBuffer);
	void OnPriorityChange(UINT nID);
// 实现
protected:
	HICON m_hIcon;

	// 生成的消息映射函数
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedPause();
	afx_msg void OnCbnSelchangeDspythrdpriority();
	afx_msg void OnCbnSelchangeCntrthrdpriority();
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -