How to get win10 setup display value

How to get win10 setup display value

Postby richard-service » Mon Oct 25, 2021 9:19 am

Hi

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

How to get this value?

Image
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan


Re: How to get win10 setup display value

Postby carlos vargas » Mon Oct 25, 2021 8:26 pm

Code: Select all  Expand view


#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

 
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1719
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: How to get win10 setup display value

Postby Silvio.Falconi » Tue Oct 26, 2021 8:33 am

carlos vargas wrote:
Code: Select all  Expand view


#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 ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7033
Joined: Thu Oct 18, 2012 7:17 pm

Re: How to get win10 setup display value

Postby richard-service » Tue Oct 26, 2021 9:00 am

Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

Re: How to get win10 setup display value

Postby richard-service » Tue Oct 26, 2021 9:02 am

carlos vargas wrote:
Code: Select all  Expand view


#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.
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 803
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 70 guests