HWND hInfoDlgWnd;//全局变量case WM_CREATE:
    hInfoDlgWnd=CreateDialog(hInst,MAKEINTRESOURCE(IDD_PLAYER_ROLE),hWnd,(DLGPROC)PlayRoleProc);
//创建非模态对话框
case WM_DESTROY:
    EndDialog(hInfoDlgWnd,IDD_PLAYER_ROLE);运行程序,打开任务管理器,每次重画屏幕时(可以不断最大化最小化窗口),发现进程占用内存会不断增加,这是为什么啊?

解决方案 »

  1.   

    先屏蔽绘图部分的代码段,然后看看
    详细检查GDI资源有没有正常释放和销毁 
      

  2.   

    After CreateDialog returns, the application displays the dialog box (if it is not already displayed) by using the ShowWindow function. The application destroys the dialog box by using the DestroyWindow function. 
    not EndDialog
      

  3.   

    moduless dialog:
    DestroyWindow();
    PostQuitMessage(0);module dialog:
    EndDialog查看 wm_paint 代码 是否泄露
      

  4.   

    DestroyWindow();
    PostQuitMessage(0);
    hInfoDlgWnd=0;
      

  5.   

     原来是在每次重画的时候未将HDC对象delete掉产生的问题,代码的习惯不好~~