var x=5; var y=0x1c; var fx=0; var fy=0; var sx=0; var sy=0; var fnd; function main(){ WriteLogFile("log1.txt", "activetate..."); //RunApp("notepad.exe", "c:\\dump1.txt"); Delay(1000); if(ActiveWindow("excel.exe")) { Delay(1000); _setfHandle9988112364(67890); Print(_getfHandle9988142364()); Print(x-y); WriteLogFile("log1.txt", "search image..."); fnd=ImageSearch("C:\\Victor\\tmp\\tmp\\cs\\macro\\tofind.bmp",40, 0,0); Print(fnd);//Print("x:" + fx + "; y:" + fy); if(fnd) { Print("X:" + getImageX() ); Print("Y:" + getImageY() ); } WriteLogFile("log1.txt", "main exit..."); Beep(); Print("Width:" + GetScreenWidth()); Print("height:" + GetScreenHeight()); Print("hwnd:="+ getWindowHandle("excel.exe")); Print("foundWind:="+ getWindowSizeLocation("excel.exe")); Print("X:="+ getWindowLocationX()); Print("Y:="+ getWindowLocationY()); Print("W:="+getWindowSizeX()); Print("H:="+getWindowSizeY()); Print("capture to ff.bmp:" + SaveRegionToImage("c:\\ff.bmp", getWindowLocationX(), getWindowLocationY(), getWindowSizeX(), getWindowSizeY())); Print("screen to fu2.bmp:"+ SaveScreenShotToImage("c:\\fu2.bmp")); Print ("app to img:" + SaveAppWindowToImage("excel.exe", "c:\\ff2.bmp")); } }