FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour detectar si el Sistema Operativo es de 32 o 64 bits
Posts: 422
Joined: Mon Aug 17, 2009 12:18 PM
detectar si el Sistema Operativo es de 32 o 64 bits
Posted: Fri Jan 08, 2010 12:14 PM

Hola:

驴Hay alguna forma de saberlo?.

Muchas gracias, :D

Saludos,



Eduardo
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: detectar si el Sistema Operativo es de 32 o 64 bits
Posted: Fri Jan 08, 2010 05:57 PM
???
Code (fw): Select all Collapse
IF ISWINXP()
   ? [32]
ELSE
    ? [16]
ENDIF
Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: detectar si el Sistema Operativo es de 32 o 64 bits
Posted: Fri Jan 08, 2010 06:39 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 422
Joined: Mon Aug 17, 2009 12:18 PM
Re: detectar si el Sistema Operativo es de 32 o 64 bits
Posted: Fri Jan 08, 2010 11:25 PM

Maestro Antonio:

Muchas gracias por la info,

驴C贸mo detecto si existe el proceso IsWow64Process?.

Muchas gracias, :D

Saludos,



Eduardo
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: detectar si el Sistema Operativo es de 32 o 64 bits
Posted: Fri Jan 08, 2010 11:47 PM
Aqui tienes el c贸digo adaptado y funcionando. Ojo no lo he probado en Windows 64, solo en Windows 7 32.
http://msdn.microsoft.com/en-us/library/ms684139(VS.85).aspx

Code (fw): Select all Collapse
function Main()

聽 聽if ISWOW64()
聽 聽 聽 MsgInfo( "Windows 64 bits" )
聽 聽else
聽 聽 聽 MsgInfo( "Windows 32 bits" )
聽 聽endif

return nil

#pragma BEGINDUMP

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

typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);

LPFN_ISWOW64PROCESS fnIsWow64Process;

HB_FUNC( ISWOW64 )
{
聽 聽 BOOL bIsWow64 = FALSE;

聽 聽 fnIsWow64Process = ( LPFN_ISWOW64PROCESS ) 
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽GetProcAddress( GetModuleHandle( TEXT( "kernel32" ) ), "IsWow64Process" );
聽 
聽 聽 if( fnIsWow64Process )
聽 聽 聽 聽 bIsWow64 = ! fnIsWow64Process( GetCurrentProcess(), &bIsWow64 );

聽 聽 hb_retl( bIsWow64 );
} 聽

#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 422
Joined: Mon Aug 17, 2009 12:18 PM
Re: detectar si el Sistema Operativo es de 32 o 64 bits
Posted: Sat Jan 09, 2010 04:04 PM

Hola:

Al final hice:

function IsOS64Bits()

LOCAL Win64 := GetENV("ProgramFiles(x86)")
LOCAL Result := .F.

IF !Empty(Win64)
Result := .T.
ELSE
Result := .F.
ENDIF

RETURN( Result )

Un saludo :D

Saludos,



Eduardo
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: detectar si el Sistema Operativo es de 32 o 64 bits
Posted: Sat Jan 09, 2010 10:07 PM
Puedes simplificarla asi :-)
Code (fw): Select all Collapse
function IsOS64Bits()

return ! Empty( GetEnv( "ProgramFiles(x86)" ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1144
Joined: Mon Feb 05, 2007 07:15 PM
Re: detectar si el Sistema Operativo es de 32 o 64 bits
Posted: Mon Jan 11, 2010 08:15 PM

o mas facil, Clic alterno a MIPC/Propiedades.. :D :D :)

Cesar Cortes Cruz

SysCtrl Software

Mexico



' Sin +- FWH es mejor "
Posts: 422
Joined: Mon Aug 17, 2009 12:18 PM
Re: detectar si el Sistema Operativo es de 32 o 64 bits
Posted: Tue Jan 12, 2010 10:35 AM

Antonio:

Muchas gracias.

C茅sar:

Lo que busco es detectarlo desde el c贸digo, de modo que la soluci贸n del maestro es la adecuada.

:D

Saludos,



Eduardo

Continue the discussion