Think your software runs great in lots of situations?  You've tested multiple monitors, all sorts of resolution, and even 16 color mode.  Good for you.

But did you try putting the taskbar at the top of the screen?

That's right, people.  Not everyone has the start menu in the lower left corner.  I do on many machines, but on my tablet I put it at the top (It's much easier to reach up when your hand is resting on the screen).  But many (many) of the applications I use don't work right with that placement.   What can happen?

  • The application appears under the taskbar
  • The app saves its position when closed, but doesn't take into account the taskbar, so it “creeps up“, moving its position up by the height of the taskbar every time it is opened. Many times, this means I can't even see the title bar of the window.
  • When you maximize the window, it leaves space at the bottom for the taskbar width, but not at the top - so there's a blank space at the bottom, and the app is under the taskbar

This happens a lot.  Not just the majority of community apps either.  ArtRage detects portrait/landscape switching very well - but works incorrectly with the taskbar at the top.  Virtual PC, despite being published by Microsoft creeps up and appears under the taskbar when docked at top.  

So what can you do to make sure your code isn't cursed at?

  1. If you're using .net, use System.Windows.Forms.Screen.GetWorkingArea(). Let it tell you the size and position of the working area of the screen.  DO NOT use it to get just the size.  Get the damn position, too. 
  2. If you're using VB6, see KB154823 : HOWTO: Determine the Size of the Desktop Area.  Note that it's a bit mislabeld, as it also shows you how to Get the damn position, too
  3. Otherwise, use the SystemParametersInfo API function (in user), and use  SPI_GETWORKAREA  to get the size and position of the work area.

 

Note the theme?  Get the position of the working area, not just the size.  I'll love you if you do.  Sorry to rant away on this -- but the fewer incorrect assumptions in your code, the happier everyone will be with it!