I have a simple script that runs in to the cmd screen, the console screen...
how can I let the console screen always on top? and if it''s possible, re size it?
I have a simple script that runs in to the cmd screen, the console screen...
how can I let the console screen always on top? and if it''s possible, re size it?
If you are creating your own window, you can use Tkinter to create an "always on top" window like so:
from Tkinter import *
root = Tk()
root.wm_attributes("-topmost", 1)
root.mainloop()
And then put whatever you want to have happen within the main loop.
If you are talking about the command prompt window, then you will have to use some Windows-specific utilities to keep that window on top. You can try this script for Autohotkey.
To do this with the cmd window, you'll probably have to invoke a lot of win32 calls.
mport win32gui, win32process, win32con
import os
windowList = []
win32gui.EnumWindows(lambda hwnd, windowList: windowList.append((win32gui.GetWindowText(hwnd),hwnd)), windowList)
cmdWindow = [i for i in windowList if "c:\python26\python.exe" in i[0].lower()]
win32gui.SetWindowPos(cmdWindow[0][1],win32con.HWND_TOPMOST,0,0,100,100,0) #100,100 is the size of the window
@Mark, I've simplify your answer with this:
import win32gui
import win32con
hwnd = win32gui.GetForegroundWindow()
win32gui.SetWindowPos(hwnd,win32con.HWND_TOPMOST,100,100,200,200,0)
thx btw