Jump to content

_ScreenCapture_Capture does not work ?


Recommended Posts

I got this from help file.

#include <ScreenCapture.au3>

Example()

Func Example()
    ; Capture full screen
    _ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image1.jpg")

    ShellExecute(@MyDocumentsDir & "\GDIPlus_Image1.jpg")

    ; Capture region
    _ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image2.jpg", 0, 0, 796, 596)

    ShellExecute(@MyDocumentsDir & "\GDIPlus_Image2.jpg")
EndFunc   ;==>Example

When i run this code, file is not created. Shell execute complaining about nonexistent file.

I also went looking for that file in that directory and its not there.

While back this script worked all of my and not my computers but now it does not.
I run win10X64 administrator account. It also failed on a windows 7 basic user account on a completely different machine.

 

 

This code also does not work.

#include <ScreenCapture.au3>
$hBmp = _ScreenCapture_Capture("")
_ScreenCapture_SaveImage(@DesktopDir & "\ShapshotTest.jpg", $hBmp)


I've had screenshot problems before (

) but it was at least taking partially. RIght now its not taking any at all.
Is this new Windows security update causing this ? My windows 10 is September 9 2017 release ISO image i never updated.

Edited by tonycst
Link to comment
Share on other sites

What worked for me was downloading AutoIt v3.3.14.4 from here ( Clicking the "Download AutoIt" button in the Download column).
(It looked like I could be downloading AutoIt v3.3.14.3.   But it is the AutoIt v3.3.14.4 version.)

Now, the examples of  post #1 work for me.

Link to comment
Share on other sites

  • Moderators

tonycst,

Malkey is correct. 3.3.14.3 had a few bugs which are corrected in 3.3.14.4 which Jon released yesterday.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

20 hours ago, Melba23 said:

tonycst,

Malkey is correct. 3.3.14.3 had a few bugs which are corrected in 3.3.14.4 which Jon released yesterday.

M23

What i dont understand is why this function was bugged if it was never updated ?
Of was that function updated without notice ?

Nothing in the release note since 3.3.14.3 mentioning any change in _ScreenCapture_Capture or ScreenCapture.au3

Edited by tonycst
Link to comment
Share on other sites

  • Moderators

tonycst,

Look at the top line of the script you posted above:

#include <ScreenCapture.au3>

If you look inside that include file you will find:

#include "GDIPlus.au3"
#include "WinAPIGdiInternals.au3"
#include "WinAPIHObj.au3"
#include "WinAPIInternals.au3"
#include "WinAPISysInternals.au3"

Looking inside the first of those files you will find that it loads further include files:

#include "GDIPlusConstants.au3"
#include "StructureConstants.au3"
#include "WinAPICom.au3"
#include "WinAPIConv.au3"
#include "WinAPIGdi.au3"
#include "WinAPIHObj.au3"
#include "WinAPIIcons.au3"

Big UDF files use a lot of smaller includes to get the work done - and it was a function in one of these smaller files (_WinAPI_WideCharToMultiByte in WinAPIConv.au3 to be exact) which had been modified to work better for most Asian users who utilise multibyte codepages. Unfortunately, because of the interlinked nature of include files as shown above, this change affected other higher-level functions, some of which were in ScreenCapture.au3 . A similar bug in the Array.au3 library stopped some SQLite scripts from working - both took a fair amount of detective work to track down, but we had corrected files posted within days in a sticky thread so that users could amend their installs.

To forestall some obvious questions, let me explain a little further:

  • Why do we have so many include files? Partly as a sop to those who complain about the size of some of the include files. Although most of the size of compiled AutoIt scripts is the interpreter itself, there are those who complain that some include files are too large it is annoying to have to include many unused functions when all that is required is a single function. Of course, Au3Stripper is available to remove all these unused functions, but some people seem to want everything done for them. Another reason is to make it easier for users to locate specific files within the libraries - some of which were getting ridiculously large.
  • Should we not have checked that the changes to these low-level functions did not have wider implications? Of course we did try to check, but errare humanum est and in this release a couple of links managed to escape our notice. Given the number of UDF amendments that were incorporated within the release and the massively interlinked nature of AutoIt's various include files, which should now be clear from the above explanations, I hope users can find it within themselves to forgive us.

And now you have a complete new release with the fixed files as standard.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

tonycst,

Fine. So next time you have a complaint (which given your past history will not be too long) I will save the wear and tear on my typing fingers.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

i didnt complain. i didnt understand why nothing was mentioned about the function in the release notes.
Once i posted that comment i thought that maybe some linked libraries that were updated might have caused this but replies came flying before i woke up to edit the post.

No where i said "what the hell man, why no one told me about that"

Put some lotion on your fingers :lol:

Link to comment
Share on other sites

  • 5 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...