ext/Win32API/point.rb


DEFINITIONS

This source file includes following functions.


   1  require 'Win32API'
   2  
   3  getCursorPos = Win32API.new("user32", "GetCursorPos", ['P'], 'V')
   4  
   5  lpPoint = " " * 8 # store two LONGs
   6  getCursorPos.Call(lpPoint)
   7  x, y = lpPoint.unpack("LL") # get the actual values
   8  
   9  print "x: ", x, "\n"
  10  print "y: ", y, "\n"
  11  
  12  ods = Win32API.new("kernel32", "OutputDebugString", ['P'], 'V')
  13  ods.Call("Hello, World\n");
  14  
  15  GetDesktopWindow = Win32API.new("user32", "GetDesktopWindow", [], 'L')
  16  GetActiveWindow = Win32API.new("user32", "GetActiveWindow", [], 'L')
  17  SendMessage = Win32API.new("user32", "SendMessage", ['L'] * 4, 'L')
  18  SendMessage.Call GetDesktopWindow.Call, 274, 0xf140, 0