0
|
1 #//////////////////////////////////////////////////////////////////////
|
|
2 #
|
|
3 # win32screeninfo.rb
|
1
|
4 # Copyright 2015 Tassilo Philipp
|
0
|
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
|