I’m developing a Pageant-like compatible appwhich used PIV cards for keys, for Windows only. I need to set the window class name to a specific string. Using wxPython, the class name seems to be hardcoded and not changeable, set as “wxWindowNR”.
There’s a method in wx to do so, named CreateUsingMSWClass. But I don’t find how to use this from wxPython.
I also tried with Tk, same issue of the constant class name, so I ended up using ctypes and raw win32 calls to manage the window. That works well for the first step, but then it is very limited and very painful to progress on the design of the application (button, clipboard, tray icon,…), that loses all the benefits from using Python. I want to benefit from wxPython which I like, and make the design and development easy.
The other way I think is to restart this app in C++ so I can benefit win32 and wx. But that would requires to rewrite many things and especially the PIV communication, and cryptography computations.
To reach this goal of changing the window class name with wxPython, I can think of some ways :
- Set up afterwards by changing the right deep property : can this be modifiable after the window creation? If so : dig down into the objects layers down to the classname field and change it.
- Reach the CreateUsingMSWClass wx method and create the window using this method.
- Change the wxPython code
- adding classname option in Frame, or
- modifying app SetClassName so all the app frames are using this as class name.
Looks like any way, I have to cross into the C++ world (wx) to make this happens, and from the Python code, that is not easy. I hope some people here would have some experiences with this and/or figure out an easy way to manage this MSW classname.