Get the size of the memory

xiaoxiao2021-03-06  105

#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 ();

转载请注明原文地址:https://www.9cbs.com/read-100989.html

New Post(0)