|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
SetTopWindow
I am calling python through a C++ application, the tkinter window comes up but is behind the mswindow and I need to bring it to the foreground.
I am using code similar to this (am not at my python pc at the moment so the code may not be exact) Code:
myProc = win32api.GetProcessId() win32gui.SetTopWindow(myProc.HWND) app.mainloop() I am receiving an error with myProc.HWND not being a true handle. I have tried the GetProcess() with no luck either. Has anyone ever solved this problem? thanks |
|
#2
|
||||
|
||||
|
I don't think you need the win32api for this as Tkinter has it's own methods:
http://www.pythonware.com/library/tkinter/introduction/x9531-window-management.htm But you can get HWND with the Tkinter winfo_id() method. Which I guess can be plugged into win32 calls. grim ![]()
__________________
*** Experimental Python Markup CGI V2 *** Last edited by Grim Archon : October 29th, 2004 at 09:19 AM. |
|
#3
|
|||
|
|||
|
Quote:
EDIT: Its a little early for me...I will try all your suggestions first before asking more questions...sorry Thankyou for you reply. I will look into that however I would appreciate it if you could point me in some direction ( give me the function I should be looking into) because the top window methods I have found with Tkinter only places the window on top of other Tkinter windows, not mswindows...perhaps I am missing something. |
|
#4
|
||||
|
||||
|
Your right about the raise method on it's own but in combination with focus_force()
Code:
mywin = Toplevel()
win32gui.BringWindowToTop(mywin.winfo_id())
#or ....
mywin.lift()
mywin.focus_force()
you should get what you want. grimey Last edited by Grim Archon : October 30th, 2004 at 03:10 AM. |
|
#5
|
|||
|
|||
|
Quote:
So simple when you see the answer. thankyou |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > SetTopWindow |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|