0

My code has a section where it opens an application called Polyworks. Polyworks is opened with the following code:

def connect_to_polyworks(self):
    self.key = win32api.RegOpenKeyEx(win32con.HKEY_CLASSES_ROOT, 'InnovMetric.PolyWorks.IMInspect', 0, win32con.KEY_READ )
    self.clsid = win32api.RegQueryValue(self.key, 'CLSID')
    self.path = "C:\\Program Files\\InnovMetric\\PolyWorks 2016 (64-bit)\\bin\\iminspect.exe"
    self.library = comtypes.client.GetModule(self.path)
    self.init = comtypes.client.CreateObject(self.clsid)
    self.interface = self.init.QueryInterface(self.library.IIMInspect)
    self.get_project = self.interface.ProjectGetCurrent()
    self.command = self.get_project.CommandCenterCreate()

Polyworks is opened as soon as my TKinter application is launched. However, within my TKinter app, there is a part where I create a toplevel() window, and I need this toplevel() window to stay above Polyworks, even when Polyworks is full screen. I tried root.attributes("-topmost", True) but I think that only applies for other TKinter windows.

Is there a way to do this?

RBuntu
  • 907
  • 10
  • 22
  • Possible duplicate of [How to put a Tkinter window on top of the others](http://stackoverflow.com/questions/8691655/how-to-put-a-tkinter-window-on-top-of-the-others) – Jean-François Fabre Sep 19 '16 at 19:14
  • use main answer from the duplicate and be sure to add `root.call('wm', 'attributes', '.', '-topmost', True) root.after_idle(root.call, 'wm', 'attributes', '.', '-topmost', False)`. – Jean-François Fabre Sep 19 '16 at 19:15
  • This doesn't work because the window I'm trying to overlay my TK app over isn't another TK app, its a separate standalone software. – RBuntu Sep 19 '16 at 21:22

0 Answers0