Page 1 of 1

How to get win10 setup display value

Posted: Mon Oct 25, 2021 9:19 am
by richard-service
Hi

Win10->Setup->Display
(Change the size of text, apps, and other items)

How to get this value?

Image

Re: How to get win10 setup display value

Posted: Mon Oct 25, 2021 6:10 pm
by Antonio Linares

Re: How to get win10 setup display value

Posted: Mon Oct 25, 2021 8:26 pm
by carlos vargas

Code: Select all | Expand



#include "fivewin.ch"

procedure main()
    ?fw_fscale(), fw_fscale()*100
return

#pragma BEGINDUMP

#include "hbapi.h"
#include <windows.h>

/*-----------------------------------------------------------------------------*/

HB_FUNC( FW_FSCALE )
{
   HWND hWnd = GetActiveWindow();
   HDC hdc = GetDC( hWnd );
   float fScale = GetDeviceCaps( hdc, LOGPIXELSX ) / 96.0f;
   ReleaseDC( hWnd, hdc );

   hb_retnd( (double) fScale );
}

/*-----------------------------------------------------------------------------*/

#pragma ENDDUMP

 

Re: How to get win10 setup display value

Posted: Tue Oct 26, 2021 8:33 am
by Silvio.Falconi
carlos vargas wrote:

Code: Select all | Expand



#include "fivewin.ch"

procedure main()
    ?fw_fscale(), fw_fscale()*100
return

#pragma BEGINDUMP

#include "hbapi.h"
#include <windows.h>

/*-----------------------------------------------------------------------------*/

HB_FUNC( FW_FSCALE )
{
   HWND hWnd = GetActiveWindow();
   HDC hdc = GetDC( hWnd );
   float fScale = GetDeviceCaps( hdc, LOGPIXELSX ) / 96.0f;
   ReleaseDC( hWnd, hdc );

   hb_retnd( (double) fScale );
}

/*-----------------------------------------------------------------------------*/

#pragma ENDDUMP

 


nice!!
do U have another sample features ?

Re: How to get win10 setup display value

Posted: Tue Oct 26, 2021 9:00 am
by richard-service

Re: How to get win10 setup display value

Posted: Tue Oct 26, 2021 9:02 am
by richard-service
carlos vargas wrote:

Code: Select all | Expand



#include "fivewin.ch"

procedure main()
    ?fw_fscale(), fw_fscale()*100
return

#pragma BEGINDUMP

#include "hbapi.h"
#include <windows.h>

/*-----------------------------------------------------------------------------*/

HB_FUNC( FW_FSCALE )
{
   HWND hWnd = GetActiveWindow();
   HDC hdc = GetDC( hWnd );
   float fScale = GetDeviceCaps( hdc, LOGPIXELSX ) / 96.0f;
   ReleaseDC( hWnd, hdc );

   hb_retnd( (double) fScale );
}

/*-----------------------------------------------------------------------------*/

#pragma ENDDUMP

 


Thank you. I will try it.