I got this far on my own:
require 'sketchup'
require 'Win32API'
GetDesktopWindow = Win32API.new("user32", "GetDesktopWindow", [], 'L')
GetDC = Win32API.new("user32", "GetDC", ['L'], 'L')
SetMapMode = Win32API.new("gdi32", "SetMapMode", ['L','N'], 'N')
MM_HIENGLISH = 5
hwnd = GetDesktopWindow.Call
puts "hwnd = #{hwnd}"
hdc = GetDC.Call(hwnd)
puts "hdc = #{hdc}"
mapmodeDefault = SetMapMode.Call(hdc, MM_HIENGLISH)
puts "mapmodeDefault = #{mapmodeDefault}"
Everything looks quite fine to this point. Now I would have to set up the TEXTMETRIC structure. I find the notations a bit difficult to grasp. So how should I declare TEXTMETRIC and pass it as a parameter in my GetTextMetrics call?
And what about this Ruby declaration:
GetTextMetrics = Win32API.new("gdi32", "GetTextMetrics", ['L','P'], 'V')