Purpose Take SAP GUI Screenshots with GuiXT and a VB.NET DLL
This tip describes how to use a custom VB.NET class library in combination with GuiXT to take
screenshots of your current SAP GUI screen. Screenshots can be full screen or a defined area, and
are especially helpful for documentation and user support.
The screenshot can also be displayed immediately on the screen using a standard Image
command in GuiXT.
As a simple example, we use the standard SAP demo report GFW_PROG_PRES_SHOW_MULT, which
generates charts in the SAP GUI. We take a screenshot of one of the charts (e.g. the lower-left),
save the image file, and reinsert it into the screen using a GuiXT command for testing purposes.
Available parameters of SaveScreenshot
Parameter
Type
Optional?
Default
Description
filename
String
No
-
Path to save the PNG screenshot
waitms
Integer
Yes
0
Wait time before capture, in milliseconds
quickmode
Integer
Yes
1
Skip window preparation if set to 1 (faster)
x, y
Integer
Yes
-1
Start coordinates of the area. -1 = full screen
width, height
Integer
Yes
-1
Size of the capture area. -1 = full screen
repeat
Integer
Yes
3
Retries the screenshot to ensure stability
excludeStatusbar
Boolean
Yes
False
If true, removes the status bar area from the screenshot
Hint: After downloading, right-click the DLL file, choose Properties, and click
Unblock in the General tab.
This step is needed because Windows may block files downloaded from the internet.