Neither getting error nor output in a basic program

#include
char hot[]="anoop";
HWND hWnd;
LRESULT CALLBACK WndProc(HWND hWnd,UINT m, WPARAM wParam, LPARAM lParam)
{
switch(m)
{

case WM_CLOSE:
DestroyWindow(hWnd);
break;
case WM_QUIT:
PostQuitMessage(0);
break;
default:
DefWindowProc(hWnd,m,wParam,lParam);
break;
}
return 0;
}
int _stdcall WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nShowCmd)
{
MSG m;
WNDCLASSEX w;
w.hIconSm=LoadIcon(NULL,IDI_APPLICATION);
w.cbClsExtra=0;
w.cbSize = sizeof(WNDCLASSEX);
w.cbWndExtra=0;
w.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
w.hCursor=LoadCursor(NULL,IDC_ARROW);
w.hIcon=LoadIcon(NULL,IDI_APPLICATION);
w.hInstance=hInstance;
w.lpfnWndProc=WndProc;
w.lpszClassName=hot;
w.lpszMenuName=NULL;
w.style=0;


RegisterClassEx(&w);

hWnd=CreateWindowEx(WS_EX_WINDOWEDGE,hot,"Whats Going On",WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,NULL,NULL,hInstance,NULL);

ShowWindow(hWnd,nShowCmd);

while(GetMessage(&m,NULL,0,0)>0)
{
TranslateMessage(&m);
DispatchMessage(&m);
}
return(m.wParam);
}






Comments

  • [code]
    : #include
    : char hot[]="anoop";
    : HWND hWnd;
    : LRESULT CALLBACK WndProc(HWND hWnd,UINT m, WPARAM wParam, LPARAM
    : lParam)
    : {
    : switch(m)
    : {
    :
    : case WM_CLOSE:
    : DestroyWindow(hWnd);
    : break;
    : case WM_QUIT:
    : PostQuitMessage(0);
    : break;
    : default:
    : [color=Red]return[/color] DefWindowProc(hWnd,m,wParam,lParam);
    : [color=Red]//break;[/color]
    : }
    : return 0;
    : }
    : int _stdcall WinMain(HINSTANCE hInstance,HINSTANCE
    : hPrevInstance,LPSTR lpCmdLine,int nShowCmd)
    : {
    : MSG m;
    : WNDCLASSEX w;
    : w.hIconSm=LoadIcon(NULL,IDI_APPLICATION);
    : w.cbClsExtra=0;
    : w.cbSize = sizeof(WNDCLASSEX);
    : w.cbWndExtra=0;
    : w.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
    : w.hCursor=LoadCursor(NULL,IDC_ARROW);
    : w.hIcon=LoadIcon(NULL,IDI_APPLICATION);
    : w.hInstance=hInstance;
    : w.lpfnWndProc=WndProc;
    : w.lpszClassName=hot;
    : w.lpszMenuName=NULL;
    : w.style=0;
    :
    :
    : RegisterClassEx(&w);
    :
    : hWnd=CreateWindowEx(WS_EX_WINDOWEDGE,hot,"Whats Going
    : On",WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_
    : USEDEFAULT,NULL,NULL,hInstance,NULL);
    :
    : ShowWindow(hWnd,nShowCmd);
    :
    : while(GetMessage(&m,NULL,0,0)>0)
    : {
    : TranslateMessage(&m);
    : DispatchMessage(&m);
    : }
    : return(m.wParam);
    : }
    [/code]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion