Hi,
The resolution of my monitor is 1920 x 1080. However, the ScrResolution() function returns
{ 1536, 864 }. Why ?
Hi,
The resolution of my monitor is 1920 x 1080. However, the ScrResolution() function returns
{ 1536, 864 }. Why ?
nSCR1 := GetSysMetrics(0)
nSCR2 := GetSysMetrics(1)I tried it. Getsystemmetrics returns the same values. Mysticism ![]()
So what ?
Natter wrote:Hi,
The resolution of my monitor is 1920 x 1080. However, the ScrResolution() function returns
{ 1536, 864 }. Why ?

Is there a function that can read the scaling of your desktop?
Thanks.
Regards,
Michel D.
Genk (Belgium)
I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773
It is not possible to get DPI yet. It might be worth trying in the registry
#define HORZRES 0x0008 // ( 8) Horizontal width in pixels
#define VERTRES 0x000A // ( 10) Vertical width in pixels
#define LOGPIXELSX 0x0058 // ( 88) Logical pixels/inch in X
#define LOGPIXELSY 0x005A // ( 90) Logical pixels/inch in Y
#define DESKTOPVERTRES 0x0075 // (117) Vertical height of entire desktop in pixels
#define DESKTOPHORZRES 0x0076 // (118) Horizontal width of entire desktop in pixels
Function GetDeskSize(nHDC,lVirtual)
LOCAL nWidth,nHeight
nWidth := HMG_CallDLL('GDI32.dll', DLL_OSAPI, 'GetDeviceCaps', nHDC, iif(lVirtual, HORZRES, DESKTOPHORZRES))
nHeight := HMG_CallDLL('GDI32.dll', DLL_OSAPI, 'GetDeviceCaps', nHDC, iif(lVirtual, VERTRES, DESKTOPVERTRES))
RETURN{nWidth,nHeight}Jimmy, great! GetDeviceCaps(DC, 117/118) works correctly
Hi Jimmy, how do I do this in FiveWin? I don't use HMG.
Hola Jimmy, ¿cómo hago esto en FiveWin? No uso HMG.
Regards, saludos.
karinha wrote:how do I do this in FiveWin? I don't use HMG.
HB_FUNC( GETDEVICECAPS ) // () HDC, int iIndex#define DESKTOPVERTRES 0x0075 // (117) Vertical height of entire desktop in pixels
#define DESKTOPHORZRES 0x0076 // (118) Horizontal width of entire desktop in pixels
Vertical := GetDeviceCaps(DC, 0x0075)
Horizontal := GetDeviceCaps(DC, 0x0076)