I found the answer... i have tried with the WNDCLASS instead of WNDCLASSEX,... it's working....and the classname was the problem... should use either L"" format or resource format.. now it's look good...
#include<windows.h>
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hi,HINSTANCE pi,LPSTR str,int i)
{
MSG msg;
HWND hwnd;
WNDCLASS wcex;
wcex.style=0;
wcex.lpfnWndProc=WndProc;
wcex.hInstance=hi;
wcex.lpszClassName=L"Hello";
wcex.lpszMenuName=0;
wcex.hbrBackground=(HBRUSH)GetStockObject(1);
wcex.hCursor=LoadCursor(NULL,IDC_ARROW);
wcex.hIcon=LoadIcon(NULL,IDI_APPLICATION);
wcex.cbClsExtra=0;
wcex.cbWndExtra=0;
if(!RegisterClass(&wcex))
MessageBox(NULL,TEXT("ERROR"),TEXT("ERROR"),0);
hwnd=CreateWindow(L"Hello",L"Hai",WS_OVERLAPPEDWINDOW,0,0,500,400,NULL,NULL,hi,NULL);
if(hwnd)
{
ShowWindow(hwnd,i);
UpdateWindow(hwnd);
while(GetMessage(&msg,hwnd,NULL,NULL))
{
DispatchMessage(&msg);
TranslateMessage(&msg);
}
}
else
MessageBox(NULL,L"Error",L"Window Creation",0);
return 0;
}
LRESULT CALLBACK WndProc(HWND hWnd,UINT message,WPARAM wp,LPARAM lp)
{
switch(message)
{
case WM_DESTROY:
PostQuitMessage(0);
break;
}
return DefWindowProc(hWnd,message,wp,lp);
}
Thank you for your response friends...........