Re: wxRuby and getting the display size

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


require ‘Win32API’

def get_desktop_area()
function =‘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’)

puts get_desktop_area

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs