Mercurial > pub > dyncall > bindings
diff ruby/rbdc/examples/win32screenres.rb @ 0:0cfcc391201f
initial from svn dyncall-1745
author | Daniel Adler |
---|---|
date | Thu, 19 Mar 2015 22:26:28 +0100 |
parents | |
children | 5e159be89d73 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ruby/rbdc/examples/win32screenres.rb Thu Mar 19 22:26:28 2015 +0100 @@ -0,0 +1,18 @@ +#////////////////////////////////////////////////////////////////////// +# +# win32screeninfo.rb +# Copyright 2007 Tassilo Philipp +# +# Dyncall sample loading user32.dll on windows and displaying a +# native windows message box by calling MessageBoxA(...). +# +#/////////////////////////////////////////////////////////////////////// + +require 'rbdc' + +l = Dyncall::ExtLib.new +if l.load('user32') != nil + puts 'width: ' + l.call(:GetSystemMetrics, 'i)i', 0).to_s + puts 'height: ' + l.call(:GetSystemMetrics, 'i)i', 1).to_s + puts 'number of monitors: ' + l.call(:GetSystemMetrics, 'i)i', 80).to_s +end