How to tell when you're about to make a big mistake

| | Comments (11)

I see this come up time and again on the forums and in personal emails (and I don't mean to pick on anyone in particular). It is unacceptable to change the user's system settings unless it's directly in response to the user asking for them to be changed. Period.

You do not change their volume for them. They have it set to whatever they want it set to. When you change it, you're barging in on their preferences and saying "I know better than you do that you want to hear my song at full volume -- it's just that good." Bad programmer, no biscuit! You don't change *any* system settings! Sounds, cursors, icons, public file associations like .mp3, whatever. It doesn't matter.

The easiest way to tell if you're about to have your application classified as malware is to take a step back and look at what you're about to do. Does it involve changing something for *just* your application? Or does it involve changing something for all applications on the system? Or all users on the system? If you're in the latter two groups, then there's a 99.5% probability that you're doing something wrong. If you're in the first camp, then you're probably fine.

Remember: the only person who knows what's best for their system is the user. Just because your program may run better with some other settings does not give you the right to change the system settings. For instance, you may know that your application looks better and runs faster when in the Windows classic theme instead of the nasty bubbly XP theme. So strip the manifest from your executable so that you don't get theme support! You do not *turn off theme support* for the user!

Ok, rant over. Carry on.

11 Comments

Sure, but remember that people use computers in a *lot* of different situations than the standard desktop situation. Take my software, for example: computerized testing. I need a way to lock down the system during a test for security purposes, which would normally make my software the absolute worst kind of malware. But in that context it's not only acceptable but absolutely necessary.

Incidentally, I'm interested in any way of disabling the task manager and other system access in Windows XP (and especially Vista). I assume this would require UAC approval in Vista. So, if you have any ideas, I'd be glad to hear them (or purchase an RBLibrary article about them...).

The rules are very different for kiosk applications or games. In that case, you are taking over the machine. Of course, you should restore all the old settings once your application terminates (especially in the case of games). I'm talking about the 95% of desktop applications out there which aren't in the special categories.

As for kiosk mode stuff, there was an entire series on how to do it with all sorts of goodies. Search for kiosk mode and you'll find plenty. The WFS has a lot of what you're after. If you still need some help, you can email me.

Aaron wrote:
"For instance, you may know that your application looks better and runs faster when in the Windows classic theme instead of the nasty bubbly XP theme. So strip the manifest from your executable so that you don't get theme support! "

Can one change the running app to be in the Classic theme from within the app? I ask because my app has a "night vision saver" mode that only works properly if the app is in classic theme mode. Currently I tell my users to change to the Classic theme using the control panel if they want to do this. It would be nice if I could just do it for them.

@Paul -- There are two ways you can do that. The right way, which is unfortunately impossible in REALbasic. And the functional way, which isn't wrong, but it's also not ideal.

Put this code in your App.Open event and it will disable themes for all the windows in your application. Note that you can't do this on a window-by-window basis.

Soft Declare Sub SetThemeAppProperties Lib "uxtheme" ( flags as Integer )

if System.IsFunctionAvailable( "SetThemeAppProperties", "uxtheme" ) then
SetThemeAppProperties( 0 )
end if

I have to admit I find this post kind of ironic :)

@Norman -- why? If you're thinking about the file association snafu post I made before, they're two totally separate concepts. We were registering *private* file types, not public ones. Those you can yank at a whim if you can assure yourself that you're the only person who uses that extension.

Nothng to do with a previous post.
Just a conversation where I was told exactly those words.

"We know better than you do."

Not quite identical words but very similar intents.

They just seem particularly ironic now in light of your post.

@Norman -- ah, yes, I recall that conversation. It still holds water as far as I'm concerned. You'll notice that the context of that conversation had absolutely nothing to do with your system settings and everything to do with the functionality internal to the application. There's a world of difference.

Not taking the bait.

What you posted about I just find ironic and really not that different from what I recall about the conversation.

That's why I said I found it ironic.

Obviously you don't see it that way.

nuff said

Heh, I wasn't attempting to bait you. I only do that in person. ;-) Sorry about that.

For instance, you may know that your application looks better and runs faster when in the Windows classic theme instead of the nasty bubbly XP theme.

Ahhhh, but the flip side is that the user may know that your application looks better with that nasty bubbly XP theme, in his/her opinion. Still probably best to leave that kind of decision to the user.

For instance, individually skinnable applications that have no option to just use the standard system theme I've chosen irritate the heck out of me. So does the fact that there are still any Windows applications out there written or updated since 2001 that ignore theme support, or use non-standard variants of it. Microsoft itself is often one of the worst offenders in this respect, and on the Mac front, Apple ain't doing so hot these days either.

Leave a comment

Disclaimer

I'm currently an employee of REAL Software. My blog is mine. The opinions represented in this blog are mine as well and may not represent my employer's opinions. All original material is copyrighted and property of the author.

REALbasic® is a registered trademark of REAL Software, Inc. REAL SQL Server™ and Lingua™ are pending trademarks of REAL Software, Inc. All rights reserved.