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?