标题:我编写的Windows程序为什么显示不了对话框
取消只看楼主
jackys2006
Rank: 1
等 级:新手上路
帖 子:195
专家分:0
注 册:2006-3-10
 问题点数:0 回复次数:0 
我编写的Windows程序为什么显示不了对话框
程序如下(为方便阅读,已简化),我在项目中也编辑好了对话框资源,但是无论如何对话框都显示不出来,请各位高手给点意见。
#include <windows.h>
        
#include "resource.h"
        

LRESULT     CALLBACK WndProc   (HWND, UINT, WPARAM, LPARAM) ;
        
BOOL        CALLBACK AboutDlgProc  (HWND, UINT, WPARAM, LPARAM) ;
        

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,

                    PSTR szCmdLine, int iCmdShow)
        
{
        
      static TCHAR szAppName[] = TEXT ("About1") ;
        
      MSG                                  msg ;
        
      HWND                                 hwnd ;
        
      WNDCLASS                             wndclass ;
        
         
     初始化 wndclass;
        
     注册 wndclass;
        
     hwnd = CreateWindow (…) ;
        
    
    DialogBox (hInstance, TEXT ("DIALOG"), hwnd, AboutDlgProc) ;
   

     ShowWindow (hwnd, iCmdShow) ;
        
     UpdateWindow (hwnd) ;
        
     while (GetMessage (&msg, NULL, 0, 0))
    {
        TranslateMessage (&msg) ;
        
         DispatchMessage (&msg) ;
    }
    return msg.wParam ;
}
        

LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    return DefWindowProc (hwnd, message, wParam, lParam) ;
}
        

BOOL CALLBACK AboutDlgProc (HWND hDlg, UINT message,WPARAM wParam, LPARAM lParam)
{
      return FALSE ;
}
搜索更多相关主题的帖子: 对话框 Windows CALLBACK 编写 
2008-07-17 19:52



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-224239-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011825 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved