MAJORSAM Posted June 1, 2009 Share Posted June 1, 2009 hi i scripted a bot wich looks for colours and picks it when found, now my question...can it find and pick it when the iexplore window runs in hidden mode? thx in advance:) Link to comment Share on other sites More sharing options...
James Posted June 1, 2009 Share Posted June 1, 2009 hii scripted a bot wich looks for colours and picks it when found, now my question...can it find and pick it when the iexplore window runs in hidden mode?thx in advance:)With some difficulty yes, you could take screenshots of the browser (if you can in hidden mode) then use ControlClick on the control. I don't know if you can take screenshots of hidden windows though? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
oMBRa Posted June 1, 2009 Share Posted June 1, 2009 I don't know if you can take screenshots of hidden windows though?yes it's possible, here is an example I found somewhere:CODE#include <GDIPlus.au3>#include <WinAPI.au3>#include <ScreenCapture.au3>_GDIPlus_Startup();$hGUI = GUICreate("Screen Capture", 400, 300, @DesktopWidth, @DesktopHeight);GUISetState()$hGUI = WinGetHandle("AutoIt Help")WinMove($hGUI, "", @DesktopWidth, @DesktopHeight)$iWidth = _WinAPI_GetWindowWidth($hGUI)$iHeight = _WinAPI_GetWindowHeight($hGUI)$hParent = GUICreate("WindowViewer", 500, 400)$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hParent)GUISetState()While 1 $hBMP = _WinCapture($hGUI, $iWidth, $iHeight) $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBMP) _GDIPlus_GraphicsDrawImageRectRect($hGraphics, $hImage, 0, 0, $iWidth, $iHeight, 50, 50, 400, 300) _GDIPlus_ImageDispose($hImage) _WinAPI_DeleteObject($hBMP) Sleep(1000)WEndFunc _WinCapture($hWnd, $iWidth = -1, $iHeight = -1) Local $iH, $iW, $hDDC, $hCDC, $hBMP If $iWidth = -1 Then $iWidth = _WinAPI_GetWindowWidth($hWnd) If $iHeight = -1 Then $iHeight = _WinAPI_GetWindowHeight($hWnd) $hDDC = _WinAPI_GetDC($hWnd) $hCDC = _WinAPI_CreateCompatibleDC($hDDC) $hBMP = _WinAPI_CreateCompatibleBitmap($hDDC, $iWidth, $iHeight) _WinAPI_SelectObject($hCDC, $hBMP) DllCall("User32.dll", "int", "PrintWindow", "hwnd", $hWnd, "hwnd", $hCDC, "int", 0) ;_WinAPI_BitBlt($hCDC, 0, 0, $iW, $iH, $hDDC, 0, 0, 0x00330008) _WinAPI_ReleaseDC($hWnd, $hDDC) _WinAPI_DeleteDC($hCDC) ;_ScreenCapture_SaveImage(@DesktopDir&"\window.jpg", $hBMP) ;_WinAPI_DeleteObject($hBMP) Return $hBMPEndFunc ;==>_WinCapture@OP also look at PixelFromMemory UDF of Manadar in the example forum Link to comment Share on other sites More sharing options...
James Posted June 1, 2009 Share Posted June 1, 2009 (edited) Shame that doesn't work on Windows Seven.Oh wait it does. I was doing it wrong Edited June 1, 2009 by JamesBrooks Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
oMBRa Posted June 1, 2009 Share Posted June 1, 2009 Shame that doesn't work on Windows Seven.Oh wait it does. I was doing it wrong yes, I forgot to mention to open the help file first , or was another problem? Link to comment Share on other sites More sharing options...
James Posted June 1, 2009 Share Posted June 1, 2009 yes, I forgot to mention to open the help file first , or was another problem?Yeah helpfile. My fault for not reading the code. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
MAJORSAM Posted June 2, 2009 Author Share Posted June 2, 2009 ohh....ty:) i think thats a liitle bit to high 4 me but thanks for ur help....i thought it might be a little bit easier...doesn´t matter, maybe i try it in a few months when ißm more expirienced in auto it Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now