int WINAPI WinMain(...) HELP!
ok i have this code...this should look very similar to many windows applications
Code:
#include <windows.h>
int WINAPI WinMain(HINSTANCE, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iShowCmd)
{
static TCHAR szAppName[] = TEXT("win prog");
HWND hwnd;
MSG msg;
WNDCLASS wndclass;
wndclass.style = WS_VREDRAW | WS_HREDRAW;
//wndclass.lpfnWndProc = WndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = hInstance;
wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)GetStockObject(GRAY_BRUSH);
wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = szAppName;
//create window code goes here
UpdateWindow(hwnd);
return 0;
}
ok i get the WNDCLASS...but what does the HWND hwnd class has to do anything with the WNDCLASS wndclass...hwnd is one object and wndclass is another object..why do i update the hwnd and not the wndclass...isnt wndclass the window?....please do help
also how is hwnd linked to wndclass....they look like two different objects..and you didnt even declare a single variable for hwnd..how can hwnd be wndclass?..please clear things up please