1. 程式人生 > >獲取螢幕大小第二篇 物理大小GetDeviceCaps 上

獲取螢幕大小第二篇 物理大小GetDeviceCaps 上

Note:  MSDN對GetDeviceCaps函式有說明:GetDeviceCaps reports info that the display driver provides. If the display driver declines to report any info,GetDeviceCaps calculates the info based on fixed calculations. If the display driver reports invalid info,GetDeviceCaps returns the invalid info. Also, if the display driver declines to report info,GetDeviceCaps
might calculate incorrect info because it assumes either fixed DPI (96 DPI) or a fixed size (depending on the info that the display driver did and didn’t provide). Unfortunately, a display driver that is implemented to the Windows Display Driver Model (WDDM) (introduced in Windows Vista) causes GDI to not get the info, soGetDeviceCaps
must always calculate the info.