   Windows class help?
  I wrote a class for windows to make the creation of a window easier. I need to know if I should change anything. Does anyone have any pointers they would be greatly appreciated. Here''s my code:   //EZWindow.h#include <windows.h>class AppWindow{private:HWND hwnd;MSG msg;WNDCLASS wc;public:AppWindow(HINSTANCE hinst){wc.cbClsExtra = 0;wc.cbWndExtra = 0;wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);wc.hCursor = LoadCursor(NULL,IDC_ARROW);wc.hIcon = LoadIcon(NULL,IDI_APPLICATION);wc.hInstance = hinst;wc.lpfnWndProc = WndProc;wc.lpszClassName = "Class";wc.lpszMenuName = NULL;wc.style = CS_VREDRAW|CS_HREDRAW;RegisterClass(&wc);hwnd = CreateWindow("Class","Window",WS_OVERLAPPEDWINDOW,0,0,CW_USEDEFAULT,CW_USEDEFAULT,NULL,NULL,hinst,NULL);}AppWindow(HINSTANCE hinst,int sizex,int sizey){wc.cbClsExtra = 0;wc.cbWndExtra = 0;wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);wc.hCursor = LoadCursor(NULL,IDC_ARROW);wc.hIcon = LoadIcon(NULL,IDI_APPLICATION);wc.hInstance = hinst;wc.lpfnWndProc = WndProc;wc.lpszClassName = "Class";wc.lpszMenuName = NULL;wc.style = CS_VREDRAW|CS_HREDRAW;RegisterClass(&wc);hwnd = CreateWindow("Class","Window",WS_OVERLAPPEDWINDOW,0,0,sizex,sizey,NULL,NULL,hinst,NULL);}AppWindow(HINSTANCE hinst,int locx,int locy,int sizex,int sizey){wc.cbClsExtra = 0;wc.cbWndExtra = 0;wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);wc.hCursor = LoadCursor(NULL,IDC_ARROW);wc.hIcon = LoadIcon(NULL,IDI_APPLICATION);wc.hInstance = hinst;wc.lpfnWndProc = WndProc;wc.lpszClassName = "Class";wc.lpszMenuName = NULL;wc.style = CS_VREDRAW|CS_HREDRAW;RegisterClass(&wc);hwnd = CreateWindow("Class","Window",WS_OVERLAPPEDWINDOW,locx,locy,sizex,sizey,NULL,NULL,hinst,NULL);}static LRESULT CALLBACK WndProc(HWND hWnd,UINT imsg, WPARAM wParam,LPARAM lParam){switch(imsg){case WM_DESTROY:PostQuitMessage(0);break;}return DefWindowProc(hWnd,imsg,wParam,lParam);}    void Display(int i){UpdateWindow(hwnd);ShowWindow(hwnd,i);while(GetMessage(&msg,NULL,0,0)){TranslateMessage(&msg);DispatchMessage(&msg);}}};Thanks a lot,Cory   Favorite Quotes:Gandalf: You shall not pass!|Smeagol: We don''t need you!|Sloth: Hey you guys!|    
  That class has no error checking. When you call Display it will block the rest of your code (which may or may not be preferable).   Colin Jeanne | Invader''s Realm;Effective double-post. 