title: An AppBar application not working correctly in Windows 8.x/10 (desktop working area does not get reduced for multiple appbars)
body: <p>I have an application that functions as an "Application Desktop Toolbar", or appbar for short. It is implemented in WPF, and appbar functionality is added by following this guideline: <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/cc144177(v=vs.85).aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/windows/desktop/cc144177(v=vs.85).aspx</a>.</p>
  
  <p>Everything works fine in Windows 7, but in Windows 8.1 (or likely in Windows 8.x) the following happens:</p>
  
  <ol>
  <li>The first appbar docked on a display's side is displayed correctly, and Windows desktop's working area is reduced accordingly, so that the appbar does not overlap any windows.</li>
  <li>The second appbar docked on the same side of the display as the first one is displayed in the right position, but Windows desktop's working area is not reduced. So the second appbar is now overlapping other windows.</li>
  <li>The third appbar docked on the same side of the display acts identically with the second one</li>
  <li>The fourth (and all appbars after it) get placed over/under the previous three, so effectively appbars start to disappear</li>
  </ol>
  
  <p>What happens in step 2 codewise is this (debugged in Windows 8.1):</p>
  
  <p>Calling</p>
  
  <p>SHAppBarMessage((int)ABMsg.ABM_QUERYPOS, ref barData);</p>
  
  <p>returns the correctly adjusted coordinates for the new appbar. But then calling</p>
  
  <p>SHAppBarMessage((int)ABMsg.ABM_SETPOS, ref barData);</p>
  
  <p>does not seem to "go through", meaning that it executes ok, and later the window will be set in the correct position (defined in barData). But the working area is not reduced, which should to my understanding happen by this function call.</p>
  
  <p>What happens in step 4 is, that SHAppBarMessage((int)ABMsg.ABM_QUERYPOS, ref barData) starts to return incorrect coordinates, such that are the same as already existing appbars. The result being that appbars get overlapped with each other.</p>
  
  <p>The same problem occurs in Windows 10, but seems that with more serious side-effects: my appbar application crashes with multiple appbar instances quite quickly, putting the whole Windows OS to a halt for a few minutes.</p>
  
  <p>I have searched the web quite extensively, but have not found a solution. Did find this article though <a href="https://github.com/PhilipRieck/WpfAppBar/issues/4" rel="nofollow">https://github.com/PhilipRieck/WpfAppBar/issues/4</a> where the symptoms experienced are quite similar to the ones with my app.</p>
  
  <p>Any help would be greatly appreciated. My guess is that this is a bug with the SHAppBarMessage API in Windows 8.x/10. But won't stop looking until it is confirmed to be so, or even better, a fix is found.</p>