view ruby/rbdc/examples/win32screenres.rb @ 63:9b6cdffd30dd

- further fixes of inccorect overflow errors for int (and long on LLP64 systems) * prev commit had bugs * added overflow tests for also int, long, long long (for both, lp64 and llp64) - while at it, fixing a reference leak when not using python with utf8 caching
author Tassilo Philipp
date Sun, 19 May 2024 15:33:18 +0200
parents 5e159be89d73
children
line wrap: on
line source

#//////////////////////////////////////////////////////////////////////
#
#	win32screeninfo.rb
#	Copyright 2015 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