views:

25

answers:

1

How can I make sure that my applicaiton User Interface is not influenced by Windows UI settings? What changes should I do to my application in order to prevent it?

+1  A: 

I don't have an exact answer for you. Only suggestions, also because I use Delphi and have no experience using winforms.

It's gonna be a challenge to find all areas affected by Windows UI settings. And it's gonna be a challenge because most development environments go out of their way to make it easy for you to follow the UI settings in your apps instead of overruling/ignoring (changes to) them.

At the very least you will have to:

  • Turn of theming support.
  • Overrule standard Windows colors, fonts, formats (date, time, numbers, money, etc) and metrics. And make sure that your app does not respond to any Windows' messages about changes to those settings (or you'll be back to square one). The messages involved seem to be: WM_WININICHANGE, WM_SETTINGCHANGE, WM_FONTCHANGE and WM_THEMECHANGED, but there might be more. In Delphi I would get some mileage on this by setting Application.UpdateFormatSettings and Application.UpdateMetricSettings to False, which would ensure that the application doesn't change any of those settings when it receives a WM_WININICHANGE message. I guess there may be a similare ploy for WinForms apps, but you'd still have to deal with (or rather ignore) the other messages.
  • Or, make sure that you do not use any of the features in you development environment that make it easy to follow these settings. For example make sure you do not use any standard color constants (like clWindowText) which aren't really constants but special values that tell the IDE/Compiler/library to pick up the values from the Windows' settings. And you will have to take the same approach with everything that is normally controlled via Windows' settings.

In the end, I don't think its worth the effort, and, as I already mentioned in my comment to your question, users won't thank you for doing this. While I understand that this is a request by your customer, you may want to think about going back to that customer and convincing them it is not such a good idea.

Marjan Venema