7

Screen.PrimaryScreen doesn't always work because on a multi-monitor setup the user may move his/her taskbar to a screen other than the primary. Finding the screen with minimum working area doesn't work too because there may be monitors with different resolutions.

Any way to locate the screen with the taskbar?

Egemenk
  • 307
  • 3
  • 9
  • 1
    possible duplicate of [Taskbar location](http://stackoverflow.com/questions/3677182/taskbar-location) – Hans Passant Sep 18 '11 at 09:00
  • This will give me the coordinates of the taskbar, I need the screen number of it. I suppose I have to loop through all screens and find out in which screen do these coordinates fall into. – Egemenk Sep 18 '11 at 09:03

2 Answers2

2

You can do it 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 the WorkingArea to determine on which screen the taskbar is.

CodeIT
  • 91
  • 10
0

I see what you mean about screens being different resolutions (thou I thought windows required all monitors to be the same resolution)

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

  • Taskbar
  • Docked Window
  • Docked Toolbar
musefan
  • 47,875
  • 21
  • 135
  • 185