根踪看看你的消息分发,函数EndDialog被执行到没有.你的是模式对话框,执行EndDialog就可关闭

解决方案 »

  1.   

    没看出什么大问题呀,这样试试看行不行://定义全局变量:
    HINSTANCE hInst =NULL;
    //在winmain中,
    hwnd=CreateWindow........
    hInst = hInstance;//加上这句
    //在主窗口过程中
    .........
    case 105:////关于对话框
      MessageBeep(0);
      //DialogBox((HINSTANCE__ *)hInstance,MAKEINTRESOURCE(102),
    //hwnd, (DLGPROC)lpfnAboutDlgProc);
       DialogBox(hInst, (LPCTSTR)102, hWnd, (DLGPROC)lpfnAboutDlgProc);
      //return 0;
       break; //用这个习惯点:)case 40003://///查询对话框
      MessageBeep(0);
      //DialogBox((HINSTANCE__ *)hInstance,"#103",
      //   hwnd,(DLGPROC)lpfDlgProc);
      DialogBox(hInst, (LPCTSTR)#103, //你上面的#103是什么意思?
                                 //对话框的ID吗?反正这里就应该是啦
         hWnd, (DLGPROC)lpfDlgProc);
        
      //return 0;
       break; 
      

  2.   

    看错了,再改:
    DialogBox(hInst, (LPCTSTR)102, hWnd, (DLGPROC)AboutDlgProc);
    DialogBox(hInst, (LPCTSTR)#103, //你上面的#103是什么意思?
                                 //对话框的ID吗?反正这里就应该是啦
         hWnd, (DLGPROC)FindDlgProc);
      

  3.   

    感觉以下用法挺老的了,不知道是在什么书上看到的
    hInstance=((LPCREATESTRUCT)lParam)->hInstance;
    ///关于对话框
        lpfnAboutDlgProc=MakeProcInstance((FARPROC)AboutDlgProc,hInstance);
    //查询对话框
    lpfnAboutDlgProc=MakeProcInstance((FARPROC)FindDlgProc,hInstance);
    关于:MakeProcInstance
    The MakeProcInstance function is obsolete. Win32 functions can be called directly. This function is provided only for compatibility with 16-bit versions of Windows. Win32-based applications should not use this function.