Help Center

AfxGetDisplayPixelsWidthfunction

Returns the width, in pixels, of the current display device on the computer on which the calling thread is running.

WindowsfunctionAfxWin.incdocumented

Syntax

FUNCTION AfxGetDisplayPixelsWidth () AS DWORD

Description

Returns the width, in pixels, of the current display device on the computer on which the calling thread is running.

Remarks

Contrarily to GetSystemMetrics or GetDeviceCaps, it returns the real width even when it is called from an application that is not DPI aware, e.g. an application running virtualized in a monitor 1920 pixels width and a DPI of 192, will return 960 pixels if it calls GetSystemMetrics or GetDeviceCaps, but will return 1920 pixels calling AfxGetDisplayPixelsWidth.

Reference

  • Include file AfxWin.inc
  • Defined in AfxNova/AfxWin.inc:2904
  • Documented in Windows/Windows Procedures.md
  • Topic: Windows Procedures