Der vereinfachte Code ist unten dargestellt.
Code: Select all
import tkinter as tk
import win32api
import win32con
import pywintypes
myapp = tk.Tk()
# Place it at the bottom of the display
myapp.geometry("300x300+200+700")
myapp.wm_attributes("-topmost", True)
myapp.wm_attributes("-disabled", True)
hwnd = pywintypes.HANDLE(int(myapp.wm_frame(), 16))
exStyle = \
win32con.WS_EX_LAYERED | \
win32con.WS_EX_NOACTIVATE | \
win32con.WS_EX_TOPMOST | \
win32con.WS_EX_TRANSPARENT
win32api.SetWindowLong(hwnd, win32con.GWL_EXSTYLE, exStyle)
myapp.mainloop()
< /code>
Wenn Sie dieses Ausführen lassen und die Windows "Touch-Tastatur" anzeigen, wird sie dahinter versteckt.hwnd_of_touchkey = win32gui.FindWindow(
None, "Microsoft Text Input Application")
win32gui.SetWindowPos(
hwnd_of_touchkey,
win32con.HWND_NOTOPMOST,
0, 0, 0, 0, win32con.SWP_NOMOVE | win32con.SWP_NOSIZE
)