function w = getWorkArea
%getWorkArea Return the screen working area, accounting for the Task Bar.
%   s = getWorkArea returns a structure containing the left, right, top,
%   and bottom borders (in pixel units) of the screen's working area.
%   Working area is defined to be that area of the screen not obscured by
%   the Windows task bar.  On non-Windows platforms, getWorkArea returns
%   a working area that is the entire screen space as returned by
%   get(0,'ScreenSize').
%   <put in a for-example>

%   Copyright 1993-2004 The MathWorks, Inc.
%   $Revision: 1.1.8.1 $  $Date: 2004/08/10 01:50:09 $

ss = get(0, 'ScreenSize');
screen_width = ss(3);
screen_height = ss(4);

if screen_width <= 1
  screen_width = 1024;
end
if screen_height <= 1
  screen_height = 768;
end

if ispc
  win_wa = winGetWorkArea;
  w.left = win_wa(1);
  w.right = win_wa(3);
  w.top = screen_height - win_wa(2);
  w.bottom = w.top - win_wa(4);
else
  w.left = 0;
  w.right = screen_width;
  w.top = screen_height;
  w.bottom = 0;
end
