Of all the stupid, slimy hack programs I've had to write...this one is just incredibly dumb...shouldn't be necessary, but is.
A customer purchased a PC upgrade to run their old machine control system HMI (Human Machine Interface) software. The HMI was written like 20 years ago, originally ran on an OS from 1996, and now needs to run on this newer embedded PC / OS. The HMI loads and runs, but will not redraw its background correctly. Through experimentation, I found that it actually does refresh and redraws itself just fine when you change the Windows system colors (like changing the current theme, etc.). This dumb little C# program automates this. The function call to SetSysColors() triggers a message sent to all running programs, forcing them to redraw. And that makes this 20 year old HMI behave. So now I have this dumb little program auto-start, and run in the background, in conjunction with the actual operator interface software.
A customer purchased a PC upgrade to run their old machine control system HMI (Human Machine Interface) software. The HMI was written like 20 years ago, originally ran on an OS from 1996, and now needs to run on this newer embedded PC / OS. The HMI loads and runs, but will not redraw its background correctly. Through experimentation, I found that it actually does refresh and redraws itself just fine when you change the Windows system colors (like changing the current theme, etc.). This dumb little C# program automates this. The function call to SetSysColors() triggers a message sent to all running programs, forcing them to redraw. And that makes this 20 year old HMI behave. So now I have this dumb little program auto-start, and run in the background, in conjunction with the actual operator interface software.
Of all the stupid, slimy hack programs I've had to write...this one is just incredibly dumb...shouldn't be necessary, but is.
A customer purchased a PC upgrade to run their old machine control system HMI (Human Machine Interface) software. The HMI was written like 20 years ago, originally ran on an OS from 1996, and now needs to run on this newer embedded PC / OS. The HMI loads and runs, but will not redraw its background correctly. Through experimentation, I found that it actually does refresh and redraws itself just fine when you change the Windows system colors (like changing the current theme, etc.). This dumb little C# program automates this. The function call to SetSysColors() triggers a message sent to all running programs, forcing them to redraw. And that makes this 20 year old HMI behave. So now I have this dumb little program auto-start, and run in the background, in conjunction with the actual operator interface software.