1 (изменено: alexii, 2013-02-04 17:37:00)

Тема: VBScript: Скриншот экрана

Привет всем. Помогите кто может. Нужно программно сделать printscreen экрана. Казалось бы просто.

Option Explicit

Dim WshShell  
Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.SendKeys "{PRTSC}"

Но почему то не работает. Подставлял CapsLock и Scroll Lock - все фурычит.

2

Re: VBScript: Скриншот экрана

SendKeys Method:

Note: You cannot send the PRINT SCREEN key {PRTSC} to an application.

JSWare - VBScript - Samples and Components

Method Capture(FilePath, Left, Top, Width, Height)
• Saves a screen capture as BMP file.
ex: ob.Capture "C:\pic.bmp", 100, 100, 300, 400

FilePath is path of BMP file to be created.
Left, Top, Width, Height reference dimensions and location
of Desktop area to capture.

Capture saves all or part of the current screen image as a BMP file.
Use Left and Top for X,Y coordinates of topleft pixel in image.
    For entire desktop use:
    boo = ob.GetDesktopSize(w, h)
    ob.Capture sFilePath, 0, 0, w, h

If FilePath does not end in ".bmp" then ".bmp" will be appended.
If FilePath exists Capture will not overwrite it.
The Capture method can be used to save a copy of graphics drawn onscreen.

Note: Capture is not a drawing method. The coordinates do not
correspond to the current canvas but rather to the Desktop. To capture
current drawing set parameters to canvas coordinates.

3

Re: VBScript: Скриншот экрана

Спасибо. Получилось