horacio wrote:Trabajo FWH 2.7 y necesito saber si estoy en Windows Vista. Mi versión no posee IsVista(). Hay alguna manera. Gracias de antemano
#include "FiveWin.ch"
Function Main()
MsgInfo( IsWinVista() )
Return Nil
//----------------------------------------------------------------------------//
Function IsWinVista()
Local IsWinVista := .F.
Local aOSInfo := GetVersionEx()
//Sistema operativo Mayor Versión (dwMajorVersion)
//Windows NT 3.51 3
//Windows 95, 98, Me y NT 4.0 4
//Windows 2000, XP y 2003 5
//Windows Vista/Longhorn 6
//---------------------------------------------------
//Sistema operativo Menor Versión (dwMinorVersion)
//Windows NT 3.51 51
//Windows 95 0
//Windows 98 10
//Windows Me 90
//Windows NT 4.0 0
//Windows 2000 0
//Windows XP 1
//Windows 2003 2
//Windows Vista/Longhorn 0
//aOSInfo[ 1 ] = dwMajorVersion
//aOSInfo[ 2 ] = dwMinorVersion
//aOSInfo[ 3 ] = dwBuildNumber
//aOSInfo[ 4 ] = dwPlatformId
//aOSInfo[ 5 ] = szCSDVersion
If aOSInfo[ 1 ] = 6 .And. aOSInfo[ 2 ] = 0
IsWinVista := .T.
EndIf
Return IsWinVista
//----------------------------------------------------------------------------//
#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
HB_FUNC( GETVERSIONEX )
{
OSVERSIONINFO OSInfo;
OSInfo.dwOSVersionInfoSize = sizeof( OSVERSIONINFO );
GetVersionEx( &OSInfo );
hb_reta( 5 );
hb_stornl( OSInfo.dwMajorVersion, -1, 1 );
hb_stornl( OSInfo.dwMinorVersion, -1, 2 );
hb_stornl( OSInfo.dwBuildNumber, -1, 3 );
hb_stornl( OSInfo.dwPlatformId, -1, 4 );
hb_storc( OSInfo.szCSDVersion, -1, 5 );
}
#pragma ENDDUMP
#include "FiveWin.ch"
Function Main()
MsgInfo( IsWinVista() )
Return Nil
//----------------------------------------------------------------------------//
Function IsWinVista()
Local IsWinVista := .F.
Local aOSInfo := GetWinVer()
//Sistema operativo Mayor Versión (dwMajorVersion)
//Windows NT 3.51 3
//Windows 95, 98, Me y NT 4.0 4
//Windows 2000, XP y 2003 Server 5
//Windows Vista/Longhorn 6
//-------------------------------------------------------------
//Sistema operativo Menor Versión (dwMinorVersion)
//Windows NT 3.51 51
//Windows 95 0
//Windows 98 10
//Windows Me 90
//Windows NT 4.0 0
//Windows 2000 0
//Windows XP 1
//Windows 2003 Server 2
//Windows Vista/Longhorn 0
//aOSInfo[ 1 ] = dwMajorVersion
//aOSInfo[ 2 ] = dwMinorVersion
//aOSInfo[ 3 ] = dwBuildNumber
//aOSInfo[ 4 ] = dwPlatformId
//aOSInfo[ 5 ] = szCSDVersion
If aOSInfo[ 1 ] = 6 .And. aOSInfo[ 2 ] = 0
IsWinVista := .T.
EndIf
Return IsWinVista
horacio wrote:Arcc,
He probado esta función pero me devuelve aOSInfo[ 1 ] = 5 y aOSInfo[ 2 ] = 1. Lo mismo que Windows XP. Alguna Idea. Gracias.
#include "FiveWin.ch"
#define HKEY_LOCAL_MACHINE 2147483650 // 0x80000002
//*******#####
Function Main()
//*******#####
Local oReg:=TReg32():New(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows NT\CurrentVersion")
MsgInfo( oReg:Get("ProductName") )
oReg:Close()
Return Nil
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 111 guests