程序中0与NULL还有区别?
#include "windows.h"LRESULT WndProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM IParam)
{
return DefWindowProc(hWnd,uMsg,wParam,IParam);
}
int WinMain(HINSTANCE hlnstance,HINSTANCE hPrevlnstance,LPSTR lpCmdLine,int nCmdShow)
{
HWND hWnd=0;
WNDCLASS window_o={0};
MSG nMsg={0};
window_o.style = CS_HREDRAW|CS_VREDRAW;
window_o.lpfnWndProc = (WNDPROC)WndProc;
window_o.cbWndExtra =0;
window_o.hInstance = 0;
window_o.hIcon=NULL;
window_o.hCursor=NULL;
window_o.hbrBackground=(HBRUSH)(COLOR_WINDOW+1);
window_o.lpszMenuName = NULL;
window_o.lpszClassName = "DDD";
RegisterClass(&window_o);
hWnd = CreateWindow("DDD","David",WS_OVERLAPPEDWINDOW,100,100,300,500,NULL,NULL,hlnstance,NULL);
ShowWindow(hWnd,SW_SHOW);
UpdateWindow(hWnd);
while(GetMessage(&nMsg,NULL,0,0))
{
TranslateMessage(&nMsg);
DispatchMessage(&nMsg);
}
}