mirror of
https://github.com/jellyfin/jellyfin-mpv-shim.git
synced 2024-11-23 05:59:43 +00:00
15 lines
412 B
Python
15 lines
412 B
Python
import win32gui
|
|
|
|
def windowEnumerationHandler(hwnd, top_windows):
|
|
top_windows.append((hwnd, win32gui.GetWindowText(hwnd)))
|
|
|
|
def raise_mpv():
|
|
results = []
|
|
top_windows = []
|
|
win32gui.EnumWindows(windowEnumerationHandler, top_windows)
|
|
for i in top_windows:
|
|
if "mpv" in i[1].lower():
|
|
win32gui.ShowWindow(i[0],5)
|
|
win32gui.SetForegroundWindow(i[0])
|
|
break
|