Physical size of the monitor
How to programmatically determine the physical size of the active monitor (width, length, or at least diagonal), in centimeters or millimeters or inches. For example, as the Everest program does.
1
Author: Nicolas Chabanovsky, 2011-09-10
3 answers
Try the GetDeviceCaps function from the Windows API, which returns the physical dimensions of the desired screen with the HORZSIZE and VERTSIZE parameters.
1
Author: stanislav, 2011-09-10 18:35:50
Pomoymu as the so
.....
var DC:HDC;
w,h:integer;
g:real;
.....
DC:=GetDC(0);//Получаем HDC активного монитора
h:=GetDeviceCaps(DC,HORZSIZE);//Возвращает ширину экрана в милиметрах
w:=GetDeviceCaps(DC,VERTSIZE);//Возвращает высоту экрана в милиметрах
g:=sqrt(sqr(w)+sqr(h))/25.4;//Получаем диагональ
1
Author: Timenzzo, 2011-09-12 03:47:04
Look at my answer in this topic
0
Author: Dex, 2017-04-12 07:33:09