#include #pragma Comment (Lib, "Guids.lib")
LPDIRECTDRAW2 lpdd; HRESULT ddrval; CoInitialize (NULL); ddrval = CoCreateInstance (CLSID_DirectDraw, NULL, CLSCTX_ALL, IID_IDirectDraw2, (void **) & lpdd); (! FAILED (ddrval)) if {ddrval = IDirectDraw2_Initialize (lpdd, NULL);} DDCAPS DDCAPS; DDCAPS.DWSIZE = SIZEOF DDCAPS; LPDD-> GetCaps (& DDCAPS, NULL); LPDD-> Release (); DWORD DWMEM = DDCAPS.DWVIDMEMTAl
INT IMEM = DWMEM / 1024/1024;
CString Strmem; StrMem.Format (_T ("Display Memory IS% D MB"), IMEM);
AfxMessageBox (Strmem); Couninitialize ();