FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour 驴c贸mo verificar la resoluci贸n de pantalla de Windows?
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: 驴c贸mo verificar la resoluci贸n de pantalla de Windows?
Posted: Mon Sep 05, 2022 09: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
Code (fw): Select all Collapse
#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 (fw): Select all Collapse
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 (fw): Select all Collapse
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
greeting,

Jimmy
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: 驴c贸mo verificar la resoluci贸n de pantalla de Windows?
Posted: Tue Sep 06, 2022 01:10 PM

Hi Jimmy, thanks, but that's not what I need.

Hola Jimmy, gracias, pero eso no es lo que necesito.

Regards, saludos.

Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341

Continue the discussion