How to determine which screen the taskbar is on

Screen.PrimaryScreen does not always work, because when configuring with multiple monitors, the user can move his taskbar to a screen other than the main one. Finding a screen with a minimum working area does not work, because there may be monitors with different resolutions.

How to find the taskbar screen?

+7
source share
2 answers

You can do this using some Windows API calls: http://winsharp93.wordpress.com/2009/06/29/find-out-size-and-position-of-the-taskbar/ After that, you can use WorkArea to determine which taskbar screen.

+2
source

I see what you mean when screens are different resolutions (I thought windows require all monitors to be the same)

But you can compare WorkArea with the actual screen area (Screen.Bounds), and if WorkArea is smaller than Bounds, then you should know that the screen you are testing has at least one of the following properties:

  • Taskbar
  • Attached window
  • Docked toolbar
0
source

All Articles