开发者

How to determine which screen the taskbar is on

开发者 https://www.devze.com 2023-04-06 03:12 出处:网络
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 w

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 res开发者_开发技巧olutions.

Any way to locate the screen with the taskbar?


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.


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
0

精彩评论

暂无评论...
验证码 换一张
取 消