[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: wxRuby and getting the display size

Jamal Mazrui

7/11/2006 3:26:00 PM

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