Solved: Lenovo Power Manager (PWMUI.EXE) Slow-Start Workaround

Posted at

Owning a Lenovo/IBM computer, meaning usually having to deal with Lenovo's quirky products,
and badly-designed/badly-programmed UI/core components. It's a fact, so don't bitch about it!

The semi-working workaround is to do a "warm-up",
i. e. - starting "C:\\Program Files (x86)\\ThinkPad\\Utilities\\PWMUI.EXE" (as admin..)
and quickly force-closing it using task-manager, followed by quickly (needs to be less than 20 seconds later) restarting the PWMUI.EXE application again, and this time it will load-up in few seconds.

The cause is (...probably) for the shittiness of Lenovo's power manager (PWMUI.exe) UI is that it was written using a very old .Net framework some of the shittiest code-library known to human race called Presentation Foundation, this code swap so many hands that older versions (2.0/3.0 -which PWMUI uses), got broken by newer versions, specifically - the resource-loading management, essentially switching from a proactive attitude to a "on-demand/on-the-fly" way, that requires getting an event signaling *stuff*... old code is getting into a "blocking mode", and waits (A LOT!) before falling back to legacy back-end which load the resources the way versions 2.0/3.0 used to..
Also, when closed, the application *Presentation Foundation will unload the resources, so you'll need to repeat the workaround each time you'll want to run the power-manager application.

I've reversed-engineered the source of the power-manager application
which is quite and easy feat, due to the fact was written practically with minimal code, using the Presentation Foundation template of .Net.
It was probably written as a Visual-Basic.Net, I've converted it to C# which is nicer ;)
and the source (if you wish to help debug it, or even compile it using a more recent version of .Net, which will surely clear some issues) is available here: