EarthQ 0 Posted November 23, 2010 Hi folks, I am trying to accomplish a very simple task, but it seems not to work no matter what I try. I want to open a window, and capture it to the clipboard using _ClipBoard_SetData(), without dumping screen capture to a file first and without using Send("!{PRINTSCREEN}") method. The script below seems to be working with bitmap data, but cannot manage to put it into the clipboard once captured. Any hints? Thanks! Run("calc.exe") ; Wait and allow 2 more seconds for Aero animations $handle = WinWait("Calculator") Sleep(2000) ; Initialize GDI+ library _GDIPlus_Startup() ; Capture 32 bit bitmap $hBitmap = _ScreenCapture_CaptureWnd("", $handle) $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap) ; This shows data info as {B96B3CAA-0728-11D3-9D7B-0000F81EF32E} GUID, MEMORYBMP ;~ $aRet = _GDIPlus_ImageGetRawFormat($hImage) ;~ MsgBox(0,"dbg",$aRet[0]) ;~ MsgBox(0,"dbg",$aRet[1]) ; Trying to put image in clipboard <- This is what seems to be failing ... _ClipBoard_SetData($hImage,$CF_BITMAP) ; Clean up resources _GDIPlus_ImageDispose($hImage) _WinAPI_DeleteObject($hBitmap) ; Shut down GDI+ library _GDIPlus_Shutdown() Share this post Link to post Share on other sites