Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I ensure that the application windows is always on top?

Tags:

python

windows

I have a simple Python script that runs in a console windows.

How can I ensure that the console window is always on top and if possible resize it?

like image 619
Bruno 'Shady' Avatar asked Dec 29 '22 07:12

Bruno 'Shady'


1 Answers

Using Mark's answer I arrived at this:

import win32gui
import win32con

hwnd = win32gui.GetForegroundWindow()
win32gui.SetWindowPos(hwnd,win32con.HWND_TOPMOST,100,100,200,200,0)
like image 94
Bruno 'Shady' Avatar answered Apr 09 '23 10:04

Bruno 'Shady'