wie kann ich die verfügbare Bildschirmfläche (Breite und Höhe) in VO 2.8 ermitteln?
Code: Select all
hScrDC := CreateDC(Cast2Psz("DISPLAY"), NULL_PSZ, NULL_PSZ , NULL_PSZ )
GetDeviceCaps(hScrDC, HORZRES)
GetDeviceCaps(hScrDC, VERTRES)
Moderator: wriedmann
Code: Select all
hScrDC := CreateDC(Cast2Psz("DISPLAY"), NULL_PSZ, NULL_PSZ , NULL_PSZ )
GetDeviceCaps(hScrDC, HORZRES)
GetDeviceCaps(hScrDC, VERTRES)
Post by Karl-Heinz »
Code: Select all
LOCAL struRect IS _winRECT
IF SystemParametersInfo(SPI_GETWORKAREA, 0, @struRect, 0)
? struRect.Top , struRect.Bottom , struRect.Left, struRect.Right
ENDIF
Post by Karl-Heinz »
Code: Select all
To get the work area of a monitor other than the primary display monitor, call the GetMonitorInfo function.
Code: Select all
LOCAL struRect IS _winrect
LOCAL a AS ARRAY
a := MonitorInfos ( GetDesktopWindow() )
? a [1] , a [2] , "primary monitor ?", a [3]
SystemParametersInfo(SPI_GETWORKAREA, 0, @struRect, 0)
? struRect.bottom , struRect.right
Code: Select all
STRUCTURE _winMONITORINFO
MEMBER cbSize AS DWORD
MEMBER rcMonitor IS _winrect
MEMBER rcWork IS _winrect
MEMBER dwFlags AS DWORD
_DLL FUNCTION MonitorFromWindow ( hwnd AS PTR , dwFlags AS DWORD ) AS PTR PASCAL:User32.MonitorFromWindow
_DLL FUNCTION GetMonitorInfo ( hMonitor AS PTR, lpmi AS _winMONITORINFO ) AS LOGIC PASCAL:User32.GetMonitorInfoA
DEFINE MONITORINFOF_PRIMARY := 0x00000001
FUNCTION MonitorInfos ( hwnd AS PTR ) AS ARRAY PASCAL
LOCAL struInfo IS _winMONITORINFO
LOCAL hMonitor AS PTR
hMonitor := MonitorFromWindow( hwnd, MONITOR_DEFAULTTONEAREST )
struInfo.cbSize := _SIZEOF(_winMONITORINFO)
GetMonitorInfo( hMonitor, @struInfo)
RETURN { struInfo.rcWork.bottom - struInfo.rcWork.top , struInfo.rcWork.right - struInfo.rcWork.Left , struInfo.dwFlags == MONITORINFOF_PRIMARY }