EightQueenDlg.h
资源名称:NQueen.rar [点击查看]
上传用户:hncsjd
上传日期:2022-07-08
资源大小:3772k
文件大小:2k
源码类别:
其他智力游戏
开发平台:
Visual C++
- // EightQueenDlg.h : header file
- //
- #if !defined(AFX_EIGHTQUEENDLG_H__EE09858D_8174_463A_B70B_F0AA7C29A7BD__INCLUDED_)
- #define AFX_EIGHTQUEENDLG_H__EE09858D_8174_463A_B70B_F0AA7C29A7BD__INCLUDED_
- #include "QueenPanel.h" // Added by ClassView
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- /////////////////////////////////////////////////////////////////////////////
- // CEightQueenDlg dialog
- class CEightQueenDlg : public CDialog
- {
- // Construction
- public:
- void UpdateUI();
- CEightQueenDlg(CWnd* pParent = NULL); // standard constructor
- void WINAPI Go();
- // Dialog Data
- //{{AFX_DATA(CEightQueenDlg)
- enum { IDD = IDD_EIGHTQUEEN_DIALOG };
- QueenPanel m_panel;
- //}}AFX_DATA
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CEightQueenDlg)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
- // Implementation
- protected:
- HICON m_hIcon;
- // Generated message map functions
- //{{AFX_MSG(CEightQueenDlg)
- virtual BOOL OnInitDialog();
- afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
- afx_msg void OnPaint();
- afx_msg HCURSOR OnQueryDragIcon();
- afx_msg void OnStart();
- afx_msg void OnPause();
- afx_msg void OnContinue();
- afx_msg void OnClose();
- afx_msg void OnStepBy();
- afx_msg void OnAbout();
- afx_msg void OnStop();
- afx_msg void OnAuto();
- afx_msg void OnNoInt();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- private:
- static DWORD WINAPI ThreadGo( LPVOID lpParam ) ;
- void UpdateQPanel(int *queen);
- void UpdateQPanel(int row, int col);
- void DoPause();
- void WINAPI Step(int i);
- BOOLEAN m_step, m_no_int;
- int count;
- int n;
- //记录皇后的位置,queen[i]表示第i行皇后的所在列的位置。
- int *queen;
- BOOLEAN *rk;
- BOOLEAN *lk;
- BOOLEAN *mk;
- BOOLEAN step, no_int;
- HANDLE pause_event, this_mutex;
- BOOLEAN canceling, running, pausing;
- };
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_EIGHTQUEENDLG_H__EE09858D_8174_463A_B70B_F0AA7C29A7BD__INCLUDED_)