WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Bitmaps and Clipboard

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

How to SnapShot the Screen to the Clipboard

Keywords: 	 SnapShot Screen Clipboard

This code will snapshot the screen to the clipboard, add a BMP file header and write out the data as a legal bmp file. Requires WinBatch 98A or newer
Snapshot(0)
size=BinaryClipGet(0,8)
bb=BinaryAlloc(size)
BinaryClipGet(bb,8)

bb2=BinaryAlloc(size+14)
BinaryPokeStr(bb2,0,"BM")
BinaryPoke4(bb2,2,size+14)
tableloc=BinaryPeek4(bb,0)+14
BinaryPoke4(bb2,10,tableloc+12)
BinaryCopy(bb2,14,bb,0,size)
BinaryWrite(bb2,"c:\temp\screenshot.bmp")
BinaryFree(bb)
BinaryFree(bb2)
Message("All","Done")

Article ID:   W12748
Filename:   SnapShot Screen to Clipboard.txt
File Created: 2001:12:19:13:58:44
Last Updated: 2001:12:19:13:58:44