int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { MSG msg; hWnd = InitWindow(hInstance, nShowCmd); if(!hWnd) { MessageBox(NULL, "初始化窗体失败!", "ERROR", MB_OK); return FALSE; } // GetClientRect(hWnd, &RectWindow); 返回的是相对坐标,左上角为(0,0) // GetWindowRect(hWnd, &RectWindow); 返回的rect会包含标题栏 if(!InitDDraw()) { MessageBox(NULL, "初始化DDRAW过程出错!", "ERROR", MB_OK); FreeDDraw(); return FALSE; } flag =1;//标志初始化ddraw完成 while (GetMessage(&msg,NULL, 0, 0))//第二个参数设为NULL,表明接收程序创建的所有窗口的所有消息 { TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam ; }
Win32Video::Win32Video (int parm) : m_Modes (NULL), m_IsFullscreen (false) { I_SetWndProc(); if (!InitD3D9()) { InitDDraw(); } }