
64 3. Introduction to DirectX
// Returns: false on error
//========================================================================
bool CreateMainWindow(HWND &hwnd, HINSTANCE hInstance, int nCmdShow)
{
WNDCLASSEX wcx;
// Fill in the window class structure with parameters
// that describe the main window.
wcx.cbSize = sizeof(wcx); // Size of structure
wcx.style = CS_HREDRAW | CS_VREDRAW;// Redraw if size changes
wcx.lpfnWndProc = WinProc; // Points to window procedure
wcx.cbClsExtra = 0; // No extra class memory
wcx.cbWndExtra = 0; // No extra window memory
wcx.hInstance = hInstance; // Handle to instance
wcx.hIcon = NULL;
wcx.hCursor = LoadCursor(NULL,IDC_ARROW); ...