I just wrote and tested the code below. It gets the coordinates of the
Windows desktop area (screen not including taskbar) via a Windows API
call.
Jamal
require ‘Win32API’
def get_desktop_area()
function = Win32API.new(‘user32.dll’, ‘SystemParametersInfoA’, [‘L’,
‘L’, ‘P’], ‘L’)
spi_getworkarea = 48
structure = ’ ’ * 4
function.Call(spi_getworkarea, 0, structure)
left, top, right, bottom = structure.unpack(‘L4’)
end
puts get_desktop_area