  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
  ! QueryInterface      '(a, b)
  ! AddRef              '()
  ! Release             '()
  ! Compact             '()
  ! CreateClipper       '(a, b, c)
  ! CreatePalette       '(a, b, c, d)
  ! CreateSurface       '(a, b, c)
  ! DuplicateSurface    '(a, b)
  ! EnumDisplayModes    '(a, b, c, d)
  ! EnumSurfaces        '(a, b, c, d)
  ! FlipToGDISurface    '()
  ! GetCaps             '(a, b)
  ! GetDisplayMode      '(a)
  ! GetFourCCCodes      '(a, b)
  ! GetGDISurface       '(a)
  ! GetMonitorFrequency '(a)
  ! GetScanLine         '(a)
  ! GetVerticalBlankStatus '(a)
  ! Initialize          '(a)
  ! RestoreDisplayMode  '()
  ! SetCooperativeLevel '(a, b)
  ! SetDisplayMode      '(a, b, c, d, e)
  ! WaitForVerticalBlank'(a, b)
  ! GetAvailableVidMem  '(a, b, c)
  ! GetSurfaceFromDC    '(a, b)
  ! RestoreAllSurfaces  '()
  ! TestCooperativeLevel'() 
  ! GetDeviceIdentifier '(a,b)
  ! StartModeTest       '(a,b,c)
  ! 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






