Re: ¿cómo verificar la resolución de pantalla de Windows?
Posted: Mon Sep 05, 2022 9:13 pm
hi karinha,
my Answer was about your Result of WMI which did not recognize "VIA Chrome9 HV IGP Family"
as in other Thread was as for "real" Desktop Size i thought your "Problem" is to "switch back" to Original Size
but there is another Aspect we have to talk about : Scale Factor <> 100 %
when set Scale to 150 % GetSysMetrics() will not give "native" Size !
try this Sample at 150 % Scale to "see" what i mean
---
as i understand you want to use App via RDP on Laptop but App have bigger Size than Display of Laptop, right ?
i have a "resize" where Font Size also is "include" so i can run a 1920 x 1080 App on 7" Display ... but very small
my Answer was about your Result of WMI which did not recognize "VIA Chrome9 HV IGP Family"
as in other Thread was as for "real" Desktop Size i thought your "Problem" is to "switch back" to Original Size
but there is another Aspect we have to talk about : Scale Factor <> 100 %
when set Scale to 150 % GetSysMetrics() will not give "native" Size !
try this Sample at 150 % Scale to "see" what i mean
- Code: Select all Expand view
- #include "fivewin.ch"
// WinUser.h
#define SM_CXSCREEN 0
#define SM_CYSCREEN 1
#define SM_CXFULLSCREEN 16
#define SM_CYFULLSCREEN 17
//WinGdi.h
#define HORZRES 8
#define VERTRES 10
#define DESKTOPVERTRES 117
#define DESKTOPHORZRES 118
PROCEDURE Main( )
LOCAL nResHoriz
LOCAL nResVert
LOCAL hDC
// WinUser.h
nResHoriz := GetSysMetrics(SM_CXSCREEN)
nResVert := GetSysMetrics(SM_CYSCREEN)
msginfo(STR(nResHoriz) + " x " + STR(nResVert), "WinUser.h" )
nResHoriz := GetSysMetrics(SM_CXFULLSCREEN)
nResVert := GetSysMetrics(SM_CYFULLSCREEN)
msginfo(STR(nResHoriz) + " x " + STR(nResVert), "WinUser.h" )
//WinGdi.h
hDC := GetDC(0)
nResHoriz := GetDeviceCaps(hDC,HORZRES)
nResVert := GetDeviceCaps(hDC,VERTRES)
msginfo(STR(nResHoriz) + " x " + STR(nResVert), "WinGdi.h" )
nResHoriz := GetDeviceCaps(hDC,DESKTOPHORZRES)
nResVert := GetDeviceCaps(hDC,DESKTOPVERTRES)
msginfo(STR(nResHoriz) + " x " + STR(nResVert), "WinGdi.h" )
RETURN
---
as i understand you want to use App via RDP on Laptop but App have bigger Size than Display of Laptop, right ?
i have a "resize" where Font Size also is "include" so i can run a 1920 x 1080 App on 7" Display ... but very small
- Code: Select all Expand view
- STATIC oDlg
#include "fivewin.ch"
PROCEDURE Main( cDBF )
LOCAL oFont, oCombo
LOCAL cCombo := "all Record"
LOCAL aItems := { "Hello", "World" }
DEFINE FONT oFont NAME "TAHOMA" SIZE 0, - 12
DEFINE WINDOW oDlg FROM 0, 0 TO 600, 800 + 16 PIXEL TITLE "TVIP"
// here now Child
@ 310, 010 COMBOBOX oCombo VAR cCombo ITEMS aItems SIZE 300, 300 PIXEL OF oDlg ON CHANGE DoChange()
oDlg:Cargo := { oDlg:nWidth, oDlg:nHeight, oDlg:oFont:nHeight }
AEVAL( oDlg:aControls, { | o | o:Cargo := { o:nTop, o:nLeft, o:nWidth, o:nHeight, o:oFont:nHeight } } )
ACTIVATE WINDOW oDlg CENTERED ;
ON RESIZE DoReSize()
RELEASE FONT oFont
RETURN
- Code: Select all Expand view
- PROCEDURE DoReSize()
LOCAL xFactor := oDlg:nWidth / oDlg:Cargo[ 1 ]
LOCAL yFactor := oDlg:nHeight / oDlg:Cargo[ 2 ]
LOCAL oCtrl, h
FOR each oCtrl in oDlg:aControls
WITH OBJECT oCtrl
:nTop := :Cargo[ 1 ] * yFactor
:nLeft := :Cargo[ 2 ] * xFactor
:nWidth := :Cargo[ 3 ] * xFactor
:nHeight := :Cargo[ 4 ] * yFactor
h := - :Cargo[ 5 ]
h := - ROUND( ( h * yFactor ), 0 )
IF h != :oFont:nInpHeight
:SetFont( :oFont:Modify( h ) )
ENDIF
:Refresh()
END
NEXT
RETURN