I am currently controlling a game with python by sending mouse and keystroke commands. What I am looking to do is have a transparent Tkinter window lay overtop of the game to provide some information such as mouse location and pixel color.
I am familiar with changing the window's alpha attribute to make it transparent but have no idea how to always keep that window in front and have mouse clicks pass through it.
My current method of controlling the game involves taking screenshots in certain locations and analyzing the color content. I will also need some way to do this without the Tkinter window interfering.
Pyscreenshot is used for screenshots win32api is used for clicking
Thank you, Alec
you can use the
SetWindowLong
function ofwin32gui
module. If you want a transparent click through window you have to applyGWL_EXSTYLE
's ony our window. Therefore you need the windowhandle of your Window.If you want to change the transparency of your window via winapi use
SetLayeredWindowAttributes
.