M
Your message showed up as all blank for me... which I've found my
messages do too if I post from Apple Mail with signing enabled. In any
case, I have the following code to get the desktop size, which may or
may not be what you want, as it excludes the space taken up by the
task bar:
require 'dl/import'
require 'dl/struct'
module User32
extend DL::Importable
typealias "BOOL", "int"
typealias "UINT", "unsigned int"
typealias "PVOID", "void *"
typealias "LONG", "long"
typealias "HWND", "void *"
RECT = struct [
"LONG left",
"LONG top",
"LONG right",
"LONG bottom"
]
dlload "user32.dll"
extern "BOOL SystemParametersInfo(UINT, UINT, PVOID, UINT)"
SPI_GETWORKAREA = 48
def self.get_work_area
rect = RECT::malloc
if(systemParametersInfo(SPI_GETWORKAREA, 0, rect.to_ptr, 0) != 0)
[rect.left, rect.top, rect.right - rect.left, rect.bottom -
rect.top]
else
raise "System call failed"
end
end
end
HTH,
Nathaniel
Terralien, Inc.
<(><
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.