  uses com\Comutil
  uses com\DirectDraw
  '
  int DirectDrawCreate lib "Ddraw.dll" (sys lpGUID, lplpDD, pUnkOuter)
  sys DD1 
  int freq
  IDirectDraw *oDD1
  
  CoInitialize 0
  
  if not DirectDrawCreate(0, @DD1, 0) then
    '
    @oDD1=DD1
    oDD1.GetMonitorFrequency(@freq)
    print "Your monitor's current frequency is " + freq + "Hz."
    '
    'sys DD1methods at DD1
    '%= GetMonitoFrequency 15*sizeof sys
    'sys c at DD1methods+GetMonitoFrequency
    'call c(DD1, @freq)
    'print "Your monitor's current frequency is " + freq + "Hz."
  else
    print "Failed to create DirectDraw1 surface. Monitor frequency unknown."
  end if
  
  CoUninitialize

