  sys CoInitialize lib "Ole32.dll" (sys pvReserved)
  sys CoUninitialize lib "Ole32.dll" ()
  sys DirectDrawCreate lib "Ddraw.dll" (sys lpGUID, lplpDD, pUnkOuter)
  dword freq

extern virtual
class DirectDraw7
  sys QueryInterface(a, b)
  sys AddRef()
  sys Release()
  sys Compact()
  sys CreateClipper(a, b, c)
  sys CreatePalette(a, b, c, d)
  sys CreateSurface(a, b, c)
  sys DuplicateSurface(a, b)
  sys EnumDisplayModes(a, b, c, d)
  sys EnumSurfaces(a, b, c, d)
  sys FlipToGDISurface()
  sys GetCaps(a, b)
  sys GetDisplayMode(a)
  sys GetFourCCCodes(a, b)
  sys GetGDISurface(a)
  sys GetMonitorFrequency(a)
  sys GetScanLine(a)
  sys GetVerticalBlankStatus(a)
  sys Initialize(a)
  sys RestoreDisplayMode()
  sys SetCooperativeLevel(a, b)
  sys SetDisplayMode(a, b, c, d, e)
  sys WaitForVerticalBlank(a, b)
  sys GetAvailableVidMem(a, b, c)
  sys GetSurfaceFromDC(a, b)
  sys RestoreAllSurfaces()
  sys TestCooperativeLevel()
  sys GetDeviceIdentifier(a,b)
  sys StartModeTest(a,b,c)
  sys EvaluateMode(a,b)
end class
end extern

#recordof DirectDraw7

  
  CoInitialize 0
  
  DirectDraw7 * DD1
  if not DirectDrawCreate(0, @@DD1, 0)
    DD1.GetMonitorFrequency(@freq)
    print ("Your monitor's current frequency is " freq "Hz.")
    DD1.Release
  else
    print ("Failed to create DirectDraw1 surface. Monitor frequency unknown.")
  end if
  
  CoUninitialize






