Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to determine the physical size of the monitor?

In inches, e.g. 21' monitor. The app is a standard WinForms app.

EDIT: It appears there really isn't a reliable way to accomplish what I need.

like image 661
AngryHacker Avatar asked Jun 10 '10 23:06

AngryHacker


1 Answers

This cannot be guaranteed. Windows cannot know the size of the monitor unless its driver interrogates it and reports the reply to windows.

However, you might want to try

SystemInformation.PrimaryMonitorSize

or GetDeviceCaps(dc, HORZSIZE) and GetDeviceCaps(dc, VERTSIZE) and then calulate the square on the hypotenuse.

Note that there is also an accepted answer to identical question right here on Stack Overflow.

like image 160
Mawg says reinstate Monica Avatar answered Sep 20 '22 08:09

Mawg says reinstate Monica