Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


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