标题:为什么运行不了?
只看楼主
你爸边哭边
Rank: 1
等 级:新手上路
帖 子:39
专家分:0
注 册:2017-10-30
结帖率:66.67%
 问题点数:0 回复次数:0 
为什么运行不了?
#include <Windows.h>
#define WINDOW_WIDTH    800                           

#define WINDOW_HEIGHT    600                        

#define WINDOW_TITLE    L"chuangkou"
LRESULT CALLBACK wndproc(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hinstance,HINSTANCE hPrevInst,LPSTR lpszCmdLine,int nCmdShow)
{
    WNDCLASS wandclass;
    HWND hwnd;
    MSG msg;
    wandclass.style=0;
    wandclass.lpfnWndProc=wndproc;
    wandclass.cbClsExtra=0;
    wandclass.cbWndExtra=0;
    wandclass.hInstance=hinstance;
    wandclass.hIcon=LoadIcon(NULL,IDI_APPLICATION);
    wandclass.hCursor=LoadCursor(NULL,IDC_ARROW);
    wandclass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
    wandclass.lpszMenuName=NULL;
    wandclass.lpszClassName=L"ForTheDreamOfGameDevelop";
    if(!RegisterClass(&wandclass))
    {return -1;
    }
     hwnd = CreateWindow( L"ForTheDreamOfGameDevelop",WINDOW_TITLE,            WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, WINDOW_WIDTH,

        WINDOW_HEIGHT, NULL, NULL, hinstance, NULL );
    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)
{switch(message)
{case WM_DESTROY:
PostQuitMessage(0);
default:
    return DefWindowProc( hwnd,message,wParam,lParam);
}
}
搜索更多相关主题的帖子: 运行 HWND NULL return message 
2018-06-04 18:22



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




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

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