BOOL CChessDlg::OnInitDialog() { CDialog::OnInitDialog(); // Add "About..." menu item to system menu. // IDM_ABOUTBOX must be in the system command range. ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) { CString strAboutMenu; strAboutMenu.LoadString(IDS_ABOUTBOX); if (!strAboutMenu.IsEmpty()) { pSysMenu->AppendMenu(MF_SEPARATOR); pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); } } // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here //创建新线程,启动界面 // m_hHandle=::CreateThread(0,0,SplashProc,this,0,&m_dwThreadID); // Sleep(1000); //加载开局库 m_pOpenBookTreeBackup=m_pOpenBookTree=new OPENBOOKTREENODE; LoadOpenBook("OpenBook.dat",m_pOpenBookTree,m_vectorChessMoveNode); // m_splashDlg.EndDialog(IDOK); m_btnComputer.SetIcon(m_hComputerIcon,32,32); m_btnStop.SetIcon(m_hStopIcon,32,32); m_btnUndo.SetIcon(m_hUndoIcon,32,32); m_btnRedo.SetIcon(m_hRedoIcon,32,32); //彩色进度条设置 m_progressThink.SetStartColor(RGB(0xFF,0xFF,0x00));//黄色 m_progressThink.SetEndColor(RGB(0x00,0x93,0x00)); //绿色 m_progressThink.SetBkColor(RGB(0xE6,0xE6,0xFA)); //淡紫色 m_progressThink.SetTextColor(RGB(0,0,255)); m_progressThink.ShowPercent(1); m_tooltip.Create(this); m_tooltip.Activate(1); m_tooltip.AddTool(GetDlgItem(IDC_LISTCHESSRECORD),"单击条目可以预览以前局面,双击条目可以快捷悔棋"); m_tooltip.AddTool(GetDlgItem(IDC_BTN_STOP),"停止思考"); m_Chessman.Create(IDB_CHESSMAN,36,14,RGB(0,255,0));//创建含有棋子图形的ImgList,用于绘制棋子 //下面这段代码取棋盘图形的宽,高 BITMAP BitMap; m_BoardBmp.LoadBitmap(IDB_CHESSBOARD); m_BoardBmp.GetBitmap(&BitMap;); //取BitMap对象 m_nBoardWidth=BitMap.bmWidth; //棋盘宽度 m_nBoardHeight=BitMap.bmHeight;//棋盘高度 m_BoardBmp.DeleteObject(); memcpy(m_byChessBoard,byInitChessBoard,90);//初始化棋盘 memcpy(m_byShowChessBoard,byInitChessBoard,90); memcpy(m_byBackupChessBoard,byInitChessBoard,90); m_pSE->SetSearchDepth(m_iInitDepth); //设定搜索层数 m_pSE->SetTimeLimit(5000); //设定限制时间 m_pSE->SetMoveGenerator(m_pMG); //给搜索引擎设定走法产生器 m_pSE->SetEveluator(m_pEval); //给搜索引擎设定估值核心 m_pSE->SetUserChessColor(m_nUserChessColor);//设定用户为黑方或红方 m_pSE->SetThinkProgress(&m_progressThink); //设定进度条 m_MoveChess.nChessID=NOCHESS;//将移动的棋子清空 CMenu menu; menu.LoadMenu(IDR_MENU_MAIN); menu.GetSubMenu(0)->EnableMenuItem(IDM_SCBOVER,0); srand(time(0)); return TRUE; // return TRUE unless you set the focus to a control }
- 1
- 粉丝: 1
- 资源: 72
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助