comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:0cfcc391201f
1 #//////////////////////////////////////////////////////////////////////
2 #
3 # win32screeninfo.rb
4 # Copyright 2007 Tassilo Philipp
5 #
6 # Dyncall sample loading user32.dll on windows and displaying a
7 # native windows message box by calling MessageBoxA(...).
8 #
9 #///////////////////////////////////////////////////////////////////////
10
11 require 'rbdc'
12
13 l = Dyncall::ExtLib.new
14 if l.load('user32') != nil
15 puts 'width: ' + l.call(:GetSystemMetrics, 'i)i', 0).to_s
16 puts 'height: ' + l.call(:GetSystemMetrics, 'i)i', 1).to_s
17 puts 'number of monitors: ' + l.call(:GetSystemMetrics, 'i)i', 80).to_s
18 end