Israel Posted September 17, 2015 Share Posted September 17, 2015 (edited) Good afternoon,I created a function in my script to take out a print of a mirroring window on my computer. He functioned normally until I format my machine. Soon after formatting it returns False in _ClipBoard_Open (0) function and have tried everything to solve. I used the _ClipBoard_Close () and _ClipBoard_Empty () and was not solved my problem.The clipboard is normal cut and paste data without any problems. But my job does not let me open this clipboard and prevent other applications to use as does the _ClipBoard_Open function.My code below, Variables $caminho, $esquerda, $topo, $largura, $altura from outside the functionFunc _CapturarEsp($caminho) Send("{PRINTSCREEN}") If Not _ClipBoard_Open(0) Then ConsoleWrite("_ClipBoard_Open failed" & @crlf) exit 1 EndIf Local $hBmp = _ClipBoard_GetDataEx($CF_BITMAP) _GDIPlus_Startup() Local $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBmp) Local $hClone = _GDIPlus_BitmapCloneArea($hImage, $esquerda, $topo, $largura, $altura, $GDIP_PXF24RGB) If @error Then exit 1 ; Save bitmap to file _GDIPlus_ImageSaveToFile($hClone, $caminho) _GDIPlus_BitmapDispose($hImage) _GDIPlus_BitmapDispose($hClone) _GDIPlus_Shutdown() If @error Then exit 1 _ClipBoard_Close() If @error Then exit 1 EndFuncDoes anyone know how to help me? what might be going wrong?Thank you! Edited September 17, 2015 by Israel Link to comment Share on other sites More sharing options...
JohnOne Posted September 17, 2015 Share Posted September 17, 2015 Can you expand on "But my job does not let me open this clipboard"? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Israel Posted September 17, 2015 Author Share Posted September 17, 2015 It is what I suspect. Because the mistake is giving is in _ClipBoard_Open (0) function that is returning False Link to comment Share on other sites More sharing options...
JohnOne Posted September 17, 2015 Share Posted September 17, 2015 What I mean is, does your computer administrator block you from using the clipboard? because that is what your statement implies.Does ClipGet() work? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Israel Posted September 21, 2015 Author Share Posted September 21, 2015 modified the script so you can be simple, as it became follows:Send("{PRINTSCREEN}") If Not _ClipBoard_Open(0) Then _WinAPI_ShowError("_ClipBoard_Open failed")It was carried out the print image and then open the clipboard so you can not be interrupted by any other application, but in _Clipboard_Open function that does this action of the error because it can not access the clipboard Link to comment Share on other sites More sharing options...
JohnOne Posted September 21, 2015 Share Posted September 21, 2015 So I think your boss blocked it. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
kylomas Posted September 22, 2015 Share Posted September 22, 2015 Isreal,See this thread for copying the screen to the clipboard.kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Israel Posted September 22, 2015 Author Share Posted September 22, 2015 Strange, if I withdraw Send ("{} PRINTSCREEN") it works but then the image will not have to work the rest of the function. The use of _ScreenCapture_Capture function ("") does not save me clipboard so you can recover forward more 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