This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import win32api | |
import ctypes | |
user32 = win32api.LoadLibrary('User32.dll') | |
# IsWindowArranged doesn't have a header file, so I assume that's why it's not exposed in win32api (py version). | |
# We can still access that function by getting it's address with ctypes. | |
# See https://learn.microsoft.com/en-us/windows/win32/winmsg/winuser/nf-winuser-iswindowarranged#remarks | |
# get function address |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sources: | |
# https://stackoverflow.com/questions/69712306/list-all-windows-with-win32gui | |
# http://timgolden.me.uk/pywin32-docs/win32gui__GetWindowRect_meth.html | |
# http://timgolden.me.uk/pywin32-docs/win32gui__MoveWindow_meth.html | |
# Todo: | |
# https://learn.microsoft.com/en-us/windows/win32/winmsg/wm-settingchange | |
# https://stackoverflow.com/questions/5981520/detect-external-display-being-connected-or-removed-under-windows-7 | |
import win32gui | |
import time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import platform | |
import tkinter as tk | |
from typing import Union | |
class ScrollableFrame(tk.Frame): | |
''' | |
A class used to create a *mostly* tkinter compatible frame that is scrollable. | |
It works by creating a master frame which contains a canvas and scrollbar(s). |