#include "FiveWin.ch"
#define HORZRES 8
#define VERTRES 10
#Define BITSPIXEL 12
#define PLANES 14
#define LOGPIXELSX 88
#define LOGPIXELSY 90
#ifndef SM_DIGITIZER
#define SM_DIGITIZER 94
/*
* GetSystemMetrics(SM_DIGITIZER) flag values
*/
#define NID_INTEGRATED_TOUCH 0x00000001
#define NID_EXTERNAL_TOUCH 0x00000002
#define NID_INTEGRATED_PEN 0x00000004
#define NID_EXTERNAL_PEN 0x00000008
#define NID_MULTI_INPUT 0x00000040
#define NID_READY 0x00000080
#endif
#ifndef SM_MAXIMUMTOUCHES
#define SM_MAXIMUMTOUCHES 95
#endif
#ifndef SM_CMOUSEBUTTONS
#define SM_CMOUSEBUTTONS 43
#endif
#define SM_XVIRTUALSCREEN 76
#define SM_YVIRTUALSCREEN 77
#define SM_CXVIRTUALSCREEN 78
#define SM_CYVIRTUALSCREEN 79
#define SM_CMONITORS 80
static lDarkTheme := .F.
//----------------------------------------------------------------------------//
function SetDarkTheme()
lDarkTheme := .T.
SetDlgGradient( { { 1, CLR_BLACK, CLR_BLACK } } )
return nil
//----------------------------------------------------------------------------//
function IsDarkTheme()
return lDarkTheme
//----------------------------------------------------------------------------//
#pragma BEGINDUMP
#include <windows.h>
#include <stdio.h>
#include "hbapi.h"
HB_FUNC( FW_GETTHEMEMODE )
{
HKEY hKey;
DWORD dwValue;
DWORD dwSize = sizeof(dwValue);
LONG result = RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", 0, KEY_READ, &hKey);
if (result == ERROR_SUCCESS)
{
result = RegQueryValueEx(hKey, "SystemUsesLightTheme", NULL, NULL, (LPBYTE)&dwValue, &dwSize);
if (result == ERROR_SUCCESS) {
hb_retc( dwValue ? "Light" : "Dark" );
}
RegCloseKey(hKey);
}
}
#pragma ENDDUMP
//----------------------------------------------------------------------------//
Function LargeFonts( nPixelX, nPixelY )
Local hDC
hDC := CreateDC( "DISPLAY", "", "" )
nPixelX := GetDeviceCaps( hDC, LOGPIXELSX )
nPixelY := GetDeviceCaps( hDC, LOGPIXELSY )
DeleteDC( hDC )
Return ( nPixelX >= 120 )
//----------------------------------------------------------------------------//
function DispFontPerSize()
local hDC, nPixelX
hDC = CreateDC( "DISPLAY", "", "" )
nPixelX = GetDeviceCaps( hDC, LOGPIXELSX )
DeleteDC( hDC )
return ( nPixelX / 96 )
//----------------------------------------------------------------------------//
function ColorsQty()
local hDC, nPlanes, nBitsPixel
hDC = CreateDC( "DISPLAY", "", "" )
nPlanes = GetDeviceCaps( hDC, PLANES )
nBitsPixel = GetDeviceCaps( hDC, BITSPIXEL )
DeleteDC( hDC )
return Int( 2 ^ ( nPlanes * nBitsPixel ) )
//----------------------------------------------------------------------------//
function ScrResolution( nWidth, nHeight )
local hDC
hDC = CreateDC( "DISPLAY", "", "" )
nWidth = GetDeviceCaps( hDC, HORZRES )
nHeight = GetDeviceCaps( hDC, VERTRES )
DeleteDC( hDC )
return { nWidth, nHeight }
//----------------------------------------------------------------------------//
#define VER_PLATFORM_WIN32s 0
#define VER_PLATFORM_WIN32_WINDOWS 1
#define VER_PLATFORM_WIN32_NT 2
function cWinVersion()
local aVersion := GetVersion()
local cVersion := ""
do case
case aVersion[ 4 ] == VER_PLATFORM_WIN32_NT
if aVersion[ 1 ] == 6
if aVersion[ 2 ] == 0
cVersion = "Vista"
elseif aVersion[ 2 ] == 1
cVersion = "7"
elseif aVersion[ 2 ] == 2
if IsWindows11()
cVersion = "11"
elseif IsWindows10()
cVersion = "10"
else
cVersion = "8"
endif
endif
endif
if aVersion[ 1 ] == 10 /* New manifest file correctly returns the value 10 for Windows 10 */
cVersion = "10"
endif
if aVersion[ 1 ] == 5
if aVersion[ 2 ] == 2
cVersion = "Server 2003"
elseif aVersion[ 2 ] == 1
cVersion = "XP"
elseif aVersion[ 2 ] == 0
cVersion = "2000"
endif
endif
if aVersion[ 1 ] <= 4
cVersion = "NT"
endif
case aVersion[ 4 ] == VER_PLATFORM_WIN32_WINDOWS
if aVersion[ 1 ] == 4
if aVersion[ 2 ] == 90
cVersion = "ME"
elseif aVersion[ 2 ] == 10
cVersion = "98"
elseif aVersion[ 2 ] == 0
cVersion = "95"
endif
endif
endcase
cVersion += IF( IsWin64(), " 64 ", " 32 " ) + "Bits"
return cVersion
//----------------------------------------------------------------------------//
function IsWinVista()
return ( "Vista" $ cWinVersion() )
//----------------------------------------------------------------------------//
function IsWinXP()
return ( "XP" $ cWinVersion() )
//----------------------------------------------------------------------------//
function IsWin2000()
return ( "2000" $ cWinVersion() )
//----------------------------------------------------------------------------//
function IsWin7()
return "7" $ cWinVersion()
//----------------------------------------------------------------------------//
function IsWin8()
return "8" == cWinVersion()
//----------------------------------------------------------------------------//
#define HKEY_LOCAL_MACHINE 2147483650 // 0x80000002
#ifndef HKEY_CURRENT_USER
#define HKEY_CURRENT_USER 2147483649 // 0x80000001
#endif
function IsWindows11()
local oReg := TReg32():New( HKEY_LOCAL_MACHINE,;
"SOFTWARE\Microsoft\Windows NT\CurrentVersion",;
.F. )
local nCurrentBuild := Val( oReg:Get( "CurrentBuild" ) )
oReg:Close()
return nCurrentBuild >= 22000
//----------------------------------------------------------------------------//
function IsWindows10()
local oReg := TReg32():New( HKEY_LOCAL_MACHINE,;
"SOFTWARE\Microsoft\Windows NT\CurrentVersion",;
.F. )
local cProductName := oReg:Get( "ProductName" )
oReg:Close()
return "Windows 10" $ cProductName
//----------------------------------------------------------------------------//
function FW_IsTouchScreen()
return ( nAnd( GetSysMetrics( SM_DIGITIZER ), ;
( NID_INTEGRATED_TOUCH + NID_MULTI_INPUT ) ) > 0 .and. ;
GetSysMetrics( SM_MAXIMUMTOUCHES ) > 0 )
//----------------------------------------------------------------------------//
function FW_IsMousePresent(); return ( GetSysMetrics( SM_CMOUSEBUTTONS ) > 0 )
//----------------------------------------------------------------------------//
function FW_IsTabletMode()
local oReg, lTabletMode := .f.
if IsWindows10()
oReg:= TReg32():New( HKEY_CURRENT_USER,;
"SOFTWARE\Microsoft\Windows\CurrentVersion\ImmersiveShell" )
lTabletMode := ( oReg:Get( "TabletMode", 0 ) > 0 )
endif
return lTabletMode
//----------------------------------------------------------------------------//
function GetCPUSpeed()
local oReg := TReg32():New( HKEY_LOCAL_MACHINE,;
"HARDWARE\DESCRIPTION\System\CentralProcessor\0",;
.F. )
local nCpuSpeed := oReg:Get( "~MHz", 0 )
oReg:Close()
return nCpuSpeed
//----------------------------------------------------------------------------//
function GetSysFont()
do case
case ! IsWinNt() .and. ! IsWin95() // Win 3.1
return "System"
endcase
return If( IsWindows10() .or. IsWin8(), "Segoe UI", "Ms Sans Serif" ) // Win NT, 9x
//----------------------------------------------------------------------------//
function BorlandVersion()
#ifdef __XHARBOUR__
local cHexVer := NumToHex( BorlandC() )
#else
local cHexVer := hb_NumToHex( BorlandC() )
#endif
return SubStr( cHexVer, 1, 1 ) + "." + SubStr( cHexVer, 2 )
//----------------------------------------------------------------------------//
function SaveDesktop( cPngFileName )
local o := TWindow()
DestroyWindow( o:hWnd )
o:hWnd = GetDesktopWindow()
// o:SaveToPng( cPngFileName )
o:SaveAsImage( cPngFileName )
return nil
//----------------------------------------------------------------------------//
#define SM_CXFULLSCREEN 16
#define SM_CYFULLSCREEN 17
function ScreenWidth()
return GetSysMetrics( SM_CXFULLSCREEN )
function ScreenHeight()
return GetSysMetrics( SM_CYFULLSCREEN )
function ScreenScaling()
return Round( ScreenSize_NoScaling()[ 1 ] / GetSysMetrics( 0 ), 2 )
function ScreenHeightMM()
local hDC, nHeight
hDC := GetDC( 0 )
nHeight := GetDeviceCaps( hDC, 6 ) // VERTSIZE = 6
ReleaseDC( 0, hDC )
return nHeight
function ScreenWidthMM()
local hDC, nWidth
hDC := GetDC( 0 )
nWidth := GetDeviceCaps( hDC, 4 ) // HORZSIZE = 4
ReleaseDC( 0, hDC )
return nWidth
function ScreenSize( lInches )
local hDC, nWidth, nHeight, nDiag
hDC := GetDC( 0 )
nWidth := GetDeviceCaps( hDC, 4 ) // HORZSIZE = 4
nHeight := GetDeviceCaps( hDC, 6 ) // VERTSIZE = 6
ReleaseDC( 0, hDC )
nDiag := SQRT( nWidth * nWidth + nHeight * nHeight )
return If( lInches == .t., nDiag / 25.4, nDiag )
//----------------------------------------------------------------------------//
function IsWin64()
return ! Empty( GetEnv( "ProgramFiles(x86)" ) )
//----------------------------------------------------------------------------//
/*
Usage: GetUsedClass() --> Array of used ClassName(s)
GetUsedClass( "MyClass" ) --> .t./.f. Check ClassName is already used
*/
function GetUsedClass( cClassName )
local n := 0, cClass, aClass := {}, lRet := .f.
while ! Empty( __ClassName( ++n ) )
cClass := Upper( __ClassName( n ) )
if cClassName != nil .and. Upper( cClassName ) == cClass
lRet := .t.
exit
endif
AAdd( aClass, cClass )
end
return if( cClassName == nil, aClass, lRet )
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
// MULTIPLE MONITORS FUNCTIONS
//----------------------------------------------------------------------------//
function FW_ActiveMonitors()
return GetSysMetrics( SM_CMONITORS )
//----------------------------------------------------------------------------//
function FW_VirtualScreen()
return TRect():New( GetSysMetrics( SM_YVIRTUALSCREEN ), GetSysMetrics( SM_XVIRTUALSCREEN ),,, ;
GetSysMetrics( SM_CXVIRTUALSCREEN ), GetSysMetrics( SM_CYVIRTUALSCREEN ) )
//----------------------------------------------------------------------------//
function FW_SetMonitor(...)
static oMonitor
local oRet
oRet := oMonitor
if PCOUNT() > 0
oMonitor := HB_ExecFromArray( "FW_GETMONITOR", HB_AParams() )
if oMonitor:lPrimary
oMonitor := nil
endif
endif
return oRet
//----------------------------------------------------------------------------//
function FW_GetMonitor( nRow, nCol ) // POINT r,c [OR] nMonitor, [or] oWnd/hWnd No params: primary monitor
local aInfo, oMonitor, nMax
if nRow == nil .and. nCol == nil
oMonitor := TMonitor():New( MonitorInfoFromRC( 20, 20 ) )
elseif HB_ISNUMERIC( nRow ) .and. HB_ISNUMERIC( nCol )
aInfo := MonitorInfoFromRC( nRow, nCol )
if !Empty( aInfo )
oMonitor := TMonitor():New( aInfo )
endif
elseif PCount() == 1
if HB_ISOBJECT( nRow ) .and. nRow:IsKindOf( "TWINDOW" )
nRow := nRow:hWnd
endif
if ValType( nRow ) != "N"
nRow := 1
endif
if IsWindow( nRow )
aInfo := MonitorInfoFromRC( nRow )
if aInfo != nil
oMonitor := TMonitor():New( aInfo )
endif
else
nMax := Max( 1, Min( nRow, FW_ActiveMonitors() ) )
oMonitor := FW_GetAllMonitors()[ nMax ]
endif
endif
return oMonitor
//----------------------------------------------------------------------------//
function FW_GetAllMonitors()
static caRect
static aMonitors := {}
local aRect, nRow, nCol, aInfo, caInfo, nMonitors, c, nMonitor := 0
aRect := FW_VirtualScreen()
if ( c := FW_ArrayAsList( aRect ) ) == caRect
return aMonitors
endif
caRect := c
aMonitors := {}
nMonitors := FW_ActiveMonitors()
for nRow := aRect[ 1 ] + 100 to aRect[ 3 ] step 100
for nCol := aRect[ 2 ] + 100 to aRect[ 4 ] step 100
aInfo := MonitorInfoFromRC( nRow, nCol )
IF HB_IsArray( aInfo )
caInfo := Str( aInfo[ 1 ] ) + ", " + Str( aInfo[ 2 ] ) + ", " + Str( aInfo[ 3 ] ) + ", " + Str( aInfo[ 4 ] )
IF AScan( aMonitors, { | x | x[ 2 ] == caInfo } ) == 0
nMonitor ++
AAdd( aMonitors, { nMonitor, caInfo, aInfo, TMonitor():New( aInfo ) } )
ENDIF
ENDIF
IF nMonitor >= nMonitors
EXIT
ENDIF
next nCol
IF nMonitor >= nMonitors
EXIT
ENDIF
next nRow
AEval( aMonitors, { |a,i| aMonitors[ i ] := a[ 4 ] } )
return aMonitors
//----------------------------------------------------------------------------//
function WndCenterEx( hWnd, hParent )
local aRect, oMonitor
if HB_ISOBJECT( hParent ) .and. hParent:IsKindOf( "TWINDOW" )
hParent := hParent:hWnd
endif
if FW_ActiveMonitors() == 1 .or. ;
( !Empty( hParent ) .and. HB_ISNUMERIC( hParent ) .and. IsWindow( hParent ) )
return WndCenter( hWnd, If( IsWindow( hParent ), hParent, 0 ) )
endif
if HB_ISNUMERIC( hParent ) .and. hParent >= 1
oMonitor := FW_GetMonitor( hParent )
elseif HB_ISOBJECT( hParent ) .and. hParent:IsKindOf( "TMONITOR" )
oMonitor := hParent
elseif Empty( oMonitor := FW_SetMonitor() )
aRect := GetCoors( hWnd )
oMonitor := FW_GetMonitor( aRect[ 1 ], aRect[ 2 ] )
endif
if oMonitor == nil .or. oMonitor:lPrimary
WndCenter( hWnd )
else
oMonitor:Center( hWnd )
endif
return nil
//----------------------------------------------------------------------------//
CLASS TMonitor STATIC FROM TRect
DATA ClientRect
DATA lPrimary
METHOD New( aInfo ) CONSTRUCTOR
METHOD Move( oWnd )
METHOD Center( oWnd )
METHOD Row( r ) INLINE ( ::nTop + r )
METHOD Col( c ) INLINE ( ::nLeft + c )
ENDCLASS
//----------------------------------------------------------------------------//
METHOD New( aInfo ) CLASS TMonitor
::Super:New( aInfo[ 1 ], aInfo[ 2 ], aInfo[ 3 ], aInfo[ 4 ] )
::ClientRect:= TRect():New( aInfo[ 5 ], aInfo[ 6 ], aInfo[ 7 ], aInfo[ 8 ] )
::lPrimary := aInfo[ 9 ]
return Self
//----------------------------------------------------------------------------//
METHOD Move( oWnd ) CLASS TMonitor
local hWnd, nTop, nLeft, w, h, aRect
local oMonitor
if HB_ISOBJECT( oWnd ) .and. oWnd:IsKindOf( "TWINDOW" )
hWnd := oWnd:hWnd
elseif HB_ISNUMERIC( oWnd )
hWnd := oWnd
endif
if Empty( hWnd ) .or. !IsWindow( hWnd )
return nil
endif
// aRect := GetCoors( hWnd ) // not correct for dialogs
aRect := GetWndRect( hWnd )
nTop := aRect[ 1 ]
nLeft := aRect[ 2 ]
w := aRect[ 4 ] - aRect[ 2 ]
h := aRect[ 3 ] - aRect[ 1 ]
oMonitor := FW_GetMonitor( hWnd )
if !oMonitor:lPrimary
nTop -= oMonitor:nTop
nLeft -= oMonitor:nLeft
endif
nTop += ::nTop
nLeft += ::nLeft
MoveWindow( hWnd, nTop, nLeft, w, h, .t. )
return nil
//----------------------------------------------------------------------------//
METHOD Center( oWnd ) CLASS TMonitor
local aPt := ::CenterPt
local hWnd, w, h, aRect
if HB_ISNUMERIC( oWnd ) .and. IsWindow( oWnd )
hWnd := oWnd
aRect := GetCoors( hWnd )
w := aRect[ 4 ] - aRect[ 2 ]
h := aRect[ 3 ] - aRect[ 1 ]
aPt[ 1 ] := Max( ::nTop, aPt[ 1 ] - Int( h / 2 ) )
aPt[ 2 ] := Max( ::nLeft, aPt[ 2 ] - Int( w / 2 ) )
MoveWindow( hWnd, aPt[ 1 ], aPt[ 2 ], w, h, .t. )
elseif HB_ISOBJECT( oWnd ) .and. oWnd:IsKindOf( "TWINDOW" )
aPt[ 1 ] -= Int( oWnd:nHeight / 2 )
aPt[ 2 ] -= Int( oWnd:nWidth / 2 )
aPt[ 1 ] := Max( ::nTop, aPt[ 1 ] )
aPt[ 2 ] := Max( ::nLeft, aPt[ 2 ] )
oWnd:Move( aPt[ 1 ], aPt[ 2 ], nil, nil, .t. )
endif
return aPt
//----------------------------------------------------------------------------//
#pragma BEGINDUMP
#if ( defined( _MSC_VER ) && ( _MSC_VER < 1500 ) ) // VC98
#ifndef _WIN32_IE
#define _WIN32_IE 0x0401
#endif
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0500
#endif
#endif
#define FKG_FORCED_USAGE
#include <windows.h>
#include <hbapi.h>
#include <fwh.h>
#if ( defined( _MSC_VER ) && ( _MSC_VER <= 1500 ) )
#define VC98
#endif
#if defined( VC98 ) && ( !defined( WINVER ) || ( WINVER < 0x0500 ) )
#ifndef MONITOR_DEFAULTTONULL
#define MONITOR_DEFAULTTONULL 0x00000000
#endif
#ifndef MONITOR_DEFAULTTOPRIMARY
#define MONITOR_DEFAULTTOPRIMARY 0x00000001
#endif
#ifndef MONITOR_DEFAULTTONEAREST
#define MONITOR_DEFAULTTONEAREST 0x00000002
#endif
#ifndef MONITORINFOF_PRIMARY
#define MONITORINFOF_PRIMARY 0x00000001
#endif
DECLARE_HANDLE(HMONITOR);
typedef struct tagMONITORINFO
{
DWORD cbSize;
RECT rcMonitor;
RECT rcWork;
DWORD dwFlags;
} MONITORINFO, *LPMONITORINFO;
#endif
HB_FUNC_STATIC( MONITORINFOFROMRC ) // ( nRow,Col ) --> { t,l,b,r,t2,l2,b2,r2,lPrimary}
{
HWND hWnd = fw_parH( 1 );
HMONITOR hMonitor;
POINT pt;
MONITORINFO mi;
mi.cbSize = sizeof( mi );
if ( hb_pcount() == 1 && IsWindow( hWnd ) )
{
#ifdef VC98
hMonitor = ( HMONITOR ) MonitorFromWindow( hWnd, MONITOR_DEFAULTTONULL );
#else
hMonitor = MonitorFromWindow( hWnd, MONITOR_DEFAULTTONULL );
#endif
}
else
{
pt.x = hb_parnl( 2 );
pt.y = hb_parnl( 1 );
#ifdef VC98
hMonitor = ( HMONITOR ) MonitorFromPoint( pt, MONITOR_DEFAULTTONULL );
#else
hMonitor = MonitorFromPoint( pt, MONITOR_DEFAULTTONULL );
#endif
}
if ( hMonitor == NULL )
{
hb_ret();
}
else
{
GetMonitorInfo( hMonitor, &mi );
hb_reta( 9 );
#ifdef __XHARBOUR__
hb_stornl( mi.rcMonitor.top, -1, 1 );
hb_stornl( mi.rcMonitor.left, -1, 2 );
hb_stornl( mi.rcMonitor.bottom, -1, 3 );
hb_stornl( mi.rcMonitor.right, -1, 4 );
hb_stornl( mi.rcWork.top, -1, 5 );
hb_stornl( mi.rcWork.left, -1, 6 );
hb_stornl( mi.rcWork.bottom, -1, 7 );
hb_stornl( mi.rcWork.right, -1, 8 );
hb_storl( ( mi.dwFlags & MONITORINFOF_PRIMARY ) == MONITORINFOF_PRIMARY, -1, 9 );
#else
hb_storvnl( mi.rcMonitor.top, -1, 1 );
hb_storvnl( mi.rcMonitor.left, -1, 2 );
hb_storvnl( mi.rcMonitor.bottom, -1, 3 );
hb_storvnl( mi.rcMonitor.right, -1, 4 );
hb_storvnl( mi.rcWork.top, -1, 5 );
hb_storvnl( mi.rcWork.left, -1, 6 );
hb_storvnl( mi.rcWork.bottom, -1, 7 );
hb_storvnl( mi.rcWork.right, -1, 8 );
hb_storvl( ( mi.dwFlags & MONITORINFOF_PRIMARY ) == MONITORINFOF_PRIMARY, -1, 9 );
#endif
}
}
#ifndef VC98
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable : 4996 ) /* GetVersionEx deprecated */
#endif
HB_FUNC( WINDOWS )
{
OSVERSIONINFOEX vi;
SYSTEM_INFO si;
vi.dwOSVersionInfoSize = sizeof( OSVERSIONINFOEX );
GetVersionEx( ( LPOSVERSIONINFO ) &vi );
GetSystemInfo( &si );
if( vi.dwMajorVersion == 10 && vi.dwMinorVersion == 0 )
{
if( vi.wProductType == VER_NT_WORKSTATION )
hb_retc( "Windows 10" );
else
hb_retc( "Windows Server 2016" );
}
if( vi.dwMajorVersion == 6 && vi.dwMinorVersion == 3 )
{
if( vi.wProductType == VER_NT_WORKSTATION )
hb_retc( "Windows 8.1" );
else
hb_retc( "Windows Server 2012" );
}
if( vi.dwMajorVersion == 6 && vi.dwMinorVersion == 2 )
{
if( vi.wProductType == VER_NT_WORKSTATION )
hb_retc( "Windows 8" );
else
hb_retc( "Windows Server 2012 R2" );
}
if( vi.dwMajorVersion == 6 && vi.dwMinorVersion == 1 )
{
if( vi.wProductType == VER_NT_WORKSTATION )
hb_retc( "Windows 7" );
else
hb_retc( "Windows Server 2008 R2" );
}
if( vi.dwMajorVersion == 6 && vi.dwMinorVersion == 0 )
{
if( vi.wProductType == VER_NT_WORKSTATION )
hb_retc( "Windows Vista" );
else
hb_retc( "Windows Server 2008" );
}
if( vi.dwMajorVersion == 5 && vi.dwMinorVersion == 2 )
{
if( GetSystemMetrics( SM_SERVERR2 ) != 0 )
hb_retc( "Windows Server 2003 R2" );
else if( vi.wSuiteMask & VER_SUITE_WH_SERVER )
hb_retc( "Windows Server 2003" );
else if( vi.wProductType == VER_NT_WORKSTATION &&
( si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 ) )
hb_retc( "Windows XP Professional x64 Edition" );
}
if( vi.dwMajorVersion == 5 && vi.dwMinorVersion == 1 )
hb_retc( "Windows XP" );
if( vi.dwMajorVersion == 5 && vi.dwMinorVersion == 0 )
hb_retc( "Windows 2000" );
}
#ifdef _MSC_VER
#pragma warning( pop )
#endif
#else
HB_FUNC( WINDOWS ) { }
#endif
#pragma ENDDUMP
//----------------------------------------------------------------------------//
#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
// This function returns original [w,h] irrespective of the
// screen scaling
HB_FUNC( SCREENSIZE_NOSCALING )
{
DEVMODE dm;
DWORD w = 0;
DWORD h = 0;
ZeroMemory(&dm, sizeof(dm));
dm.dmSize = sizeof(dm);
if (EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dm) != 0)
{
w = dm.dmPelsWidth;
h = dm.dmPelsHeight;
}
hb_reta(2);
#ifdef __XHARBOUR__
hb_stornl( ( long ) w, -1, 1 );
hb_stornl( ( long ) h, -1, 2 );
#else
hb_storvnl( ( long ) w, -1, 1 );
hb_storvnl( ( long ) h, -1, 2 );
#endif
}
#pragma ENDDUMP
//----------------------------------------------------------------------------//