Micro Focus QTP (UFT) Forums
Write a program to Capture Desktop Screen shot - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Write a program to Capture Desktop Screen shot (/Thread-Write-a-program-to-Capture-Desktop-Screen-shot)



Write a program to Capture Desktop Screen shot - kumarmoyilla - 06-28-2011

Write a program to Capture Desktop Screen shot




RE: Write a program to Capture Desktop Screen shot - supputuri - 06-28-2011

HI,

you can use the QTP in-built method "Desktop.CaptureBitmap"

Code:
Desktop.CaptureBitmap("SampleImage.bmp",True)
Let me know if you need any help


RE: Write a program to Capture Desktop Screen shot - souvikghosh_diatm - 07-11-2011

try the follwing in .vbs file......




Code:
Set oWordBasic = CreateObject("Word.Basic")

oWordBasic.SendKeys "{prtsc}"

oWordBasic.AppClose "Microsoft Word"

Set oWordBasic = Nothing

WScript.Sleep 2000

set WshShell = CreateObject("WScript.Shell")

WshShell.Run "mspaint"

WScript.Sleep 2000

set shl=createobject("shell.application")  

shl.MinimizeAll  

WScript.Sleep 1000

shl.UndoMinimizeAll

Set shl=Nothing

WScript.Sleep 1000

WshShell.AppActivate "untitled - Paint"

WScript.Sleep 1000


WshShell.SendKeys "^v"

WScript.Sleep 500


WshShell.SendKeys "^s"

WScript.Sleep 500

WshShell.SendKeys "c:\scrnshot.jpeg"

WScript.Sleep 500

WshShell.SendKeys "{ENTER}", True

Set WshShell=Nothing

WScript.Quit