| 发表于:2007-05-05 16:41:15 楼主 |
各位高手: 我最近在网上搜到一个跳棋的程序,我想在自己的对话框中,暂时命名为dialog1设置一个按钮,然后再调用这个程序,可是出现了一点小问题... 在按钮的响应函数中,我是这样定义的: void cokdlg::onbnenter() { // todo: add your control notification handler code here cttqdlg dlg; msg msg; cwnd* m_pmainwnd; m_pmainwnd = &dlg; int nresponse = dlg.createex(0, afxregisterwndclass(0), "跳子棋 ", ws_popup ¦ws_sysmenu, crect(0,0,453,504),null,null,null); hbmp = (hbitmap)loadimage(afxgetinstancehandle(), makeintresource(idb_bitmbk), image_bitmap, 0, 0, lr_createdibsection); hbmmp = (hbitmap)loadimage(afxgetinstancehandle(), makeintresource(idb_bitmbk1), image_bitmap, 0, 0, lr_createdibsection); bitmap bm; ::getobject(hbmp, sizeof(bm), &bm); hrgn h = bitmaptoregion(hbmp); if (h) ::setwindowrgn(m_pmainwnd-> m_hwnd, h, true); dlg.showwindow(sw_show); dlg.updatewindow(); while(getmessage(&msg,(hwnd)null,0,0)){ translatemessage(&msg); dispatchmessage(&msg); } } 其中cttqdlg是由cwnd派生的. 在cttqdlg中有一个newgame()函数,用来显示一个模态的对话框,暂时取名为dialog2. 运行的时候,当我显示dialog2的时候发现:dialog2可以跟cttqdlg的对象进行切换,对dialog1不能够切换.而在这个游戏的源程序中,dialog2对cttqdlg的对象是不可以切换的. 我要实现的是,dialog2对以上这两个对象都不能够切换,该怎样实现的啊.如果需要的话,我可以把整个代码发给你帮我分析.拜托各位了! |
|
|
|
|