Hi
Win10->Setup->Display
(Change the size of text, apps, and other items)
How to get this value?
#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
carlos vargas wrote:
- Code: Select all Expand view RUN
#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
Antonio Linares wrote:Richard,
https://stackoverflow.com/questions/35233182/how-can-i-change-windows-10-display-scaling-programmatically-using-c-sharp/57397039#57397039
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-displayconfigsetdeviceinfo
http://www.xtremedotnettalk.com/threads/changing-screen-resolution-c.73184/
carlos vargas wrote:
- Code: Select all Expand view RUN
#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
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot], wilsongamboa and 65 guests