This project is read-only.
Python usage:
# cmd> regsvr32.exe miceshot.dll
import os, msvcrt, sys
import win32com.client
from tempfile import TemporaryFile 

def float_name(afolder):
    with TemporaryFile("wb", suffix=".bmp", dir = afolder) as thefile: thempfile = thefile.name
    return os.path.join( afolder, thempfile )
    
thefolder = sys.argv[1] if len(sys.argv) > 1 else r"."

theobj = win32com.client.Dispatch("oleauto.screenshot")
print "{ cursor: %s, width: %d, height: %d }" % (theobj.cursor, theobj.width, theobj.height)

theobj.pixelBits = 24
thempfile = float_name(thefolder)
print("miceshot, path name: %s" % thempfile)
thefile = os.open( thempfile, os.O_WRONLY | os.O_BINARY | os.O_CREAT )
try:
    theobj.load(msvcrt.get_osfhandle(thefile))
finally:
    os.close( thefile )

theobj.cursor = False
theobj.pixelBits = 16
thempfile = float_name(thefolder)
print("screenshot, path name: %s" % thempfile)
thefile = os.open( thempfile, os.O_WRONLY | os.O_BINARY | os.O_CREAT )
thereply = theobj.load(msvcrt.get_osfhandle(thefile), True)
#   if thereply then it is really fullscreen

Last edited Apr 16, 2014 at 6:00 AM by kannoner, version 7