require 'win32GuiTest' gui=Win32GuiTest.new gui.run('mspaint.exe') sleep 1 w=gui.findWindowLikeName('ƒyƒCƒ“ƒg').first[0] gui.setForegroundWindow(w) gui.moveWindow(w) r=gui.getWindowRect(gui.getForegroundWindow) sleep 1 360.times do |i| rad=i*2*3.14/360.0 x=r[0]+200+100*Math.cos(rad) y=r[1]+200+100*Math.sin(rad) gui.mouseMoveAbsPix(x.to_i,y.to_i) gui.sendLButtonDown if i==0 end gui.sendLButtonUp gui.sendKeys('%f',2) gui.sendKeys('x',1) gui.sendKeys('y',1) gui.sendKeys('TestBitmap.bmp',2) gui.sendKeys('{ENTER}',2)