Короче, всем пацанам в помощь - программа на питоне, переключающая окно на TSLab и делающая скрин.
# -*- coding: utf-8 -*-
print "TSLab image grabber [http://rts-robot.ru]"
from time import sleep
print ("Grabbing pic...")
"""
Now grab the pic!
"""
from os import system
from taskbar import hide_taskbar, unhide_taskbar
import win32gui
import time
system("title " + "grab")
from PIL import ImageGrab
toplist = []
winlist = []
def enum_callback(hwnd, results):
winlist.append((hwnd, win32gui.GetWindowText(hwnd)))
a = 0
win32gui.EnumWindows(enum_callback, toplist)
mywnd = [(hwnd, title) for hwnd, title in winlist if 'grab' in title.lower()]
tswnd = [(hwnd, title) for hwnd, title in winlist if 'TSLab (' in title]
if mywnd:
try:
#print (mywnd)
mywnd = mywnd[0]
import win32con
win32gui.ShowWindow(mywnd[0], win32con.SW_MINIMIZE) # Minimize window
except:
pass
if tswnd:
try:
#print (tswnd)
tswnd = tswnd[0]
import win32con
win32gui.SetForegroundWindow(tswnd[0])
win32gui.ShowWindow(tswnd[0], win32con.SW_MAXIMIZE)
win32gui.ShowWindow(tswnd[0], win32con.SW_SHOW)
except:
unhide_taskbar()
print 'No TSLab found, sorry!'
quit()
hide_taskbar()
for a in xrange(5):
sleep(1)
print ("Sleeping, [%s] seconds left..." % (5 - a))
ImageGrab.grab().save('robots.jpg', "JPEG")
unhide_taskbar()
Табы имеют значение, поэтому - кому нужно, берите
исходник и exe-шник для x64