macs Posted December 10, 2021 Report Share Posted December 10, 2021 Olá pessoal, tudo bem! Estou precisando de uma função que me retorne se o Windows é 32 ou 64bits. Desde já agradeço! Quote Link to comment Share on other sites More sharing options...
kapiaba Posted December 10, 2021 Report Share Posted December 10, 2021 LOCAL cSistOper cSistOper := " Sistema Operacional: " + OS() +" - "+ IIF( IsWin64()," (64 bits)", " (32 bits)" ) Abs. Quote Link to comment Share on other sites More sharing options...
Theotokos Posted December 10, 2021 Report Share Posted December 10, 2021 estranho que esta funcao OS() retorna pra mim Windows 8 profissional e meu windows 10 Quote Link to comment Share on other sites More sharing options...
macs Posted December 10, 2021 Author Report Share Posted December 10, 2021 Não sei porque, mais o meu windows é 64bits, e o retorno diz que é 32bits Quote Link to comment Share on other sites More sharing options...
kapiaba Posted December 10, 2021 Report Share Posted December 10, 2021 [ WinVersion() Quote Link to comment Share on other sites More sharing options...
kapiaba Posted December 10, 2021 Report Share Posted December 10, 2021 Look: #include "Fivewin.ch" //----------------------------------------------------------------------------// // Test inicial: Menu standard non style // //----------------------------------------------------------------------------// Static oWnd Static oFont Static nHFont Static cFont Static nWFont Function Main() cFont := "Verdana" nHFont := 14 DEFINE FONT oFont NAME cFont SIZE 0, -nHFont DEFINE WINDOW oWnd ; TITLE "Test Menu" + " - Ver.: " + FWVERSION + if( IsExe64(), ; " ( 64", " ( 32" ) + " bits ) - " + FWString( "User" ) + ; ": " + WNetGetUser() + " - " + hb_Compiler() + " - " + OS() ; + " - Version: " + cWinVersion() ; MENU MenuSal() ; COLOR CLR_WHITE, METRO_STEEL ACTIVATE WINDOW oWnd MAXIMIZED RELEASE FONT oFont Return nil //----------------------------------------------------------------------------// Function MenuSal() local oMnu MENU oMnu FONT oFont 2013 ADJUST ; NOBORDER ; //UPPERMNU ; COLORSEPARATOR CLR_RED ; COLORMENU CLR_HGRAY, CLR_BLUE ; COLORSELECT METRO_STEEL, METRO_STEEL, RGB( 0, 0, 1 ) ; COLORLEFT CLR_WHITE ; COLORRIGHT CLR_HGRAY ; // NOINHERIT ; // FACTOR 4 ; ROUND 1 ; //5 // RIGHTSPACE 10 ; HEIGHT 1.0 * 2 MENUITEM "Datos " MENU MENUITEM "Proveedores" ACTION MsgInfo( "Proveedores" ) MENUITEM "Clientes" ACTION MsgInfo( "Clientes" ) SEPARATOR MENUITEM "Articulos" ACTION MsgInfo( "Articulos" ) SEPARATOR MENUITEM "Fichero de Zonas" ACTION MsgInfo( "Fichero de Zonas" ) MENUITEM "Ficheros Auxiliares" MENU MENUITEM "Agentes" SEPARATOR MENUITEM "Formas de Pago" MENUITEM "Entidades Bancarias" ENDMENU MENUITEM "Tools" MENU MENUITEM "Copia de Seguridad" MENUITEM "Herramientas" SEPARATOR MENUITEM "Otros" MENU MENUITEM "Item 1" ACTION MsgInfo( "Item_1" ) SEPARATOR MENUITEM "Item 2" ACTION MsgInfo( "Item_2" ) ENDMENU ENDMENU ENDMENU MENUITEM "Otros Items" ACTION oWnd:End () MENU MENUITEM "Item 1" ACTION MsgInfo( "Item_1" ) MENUITEM "Item 2" ACTION MsgInfo( "Item_2" ) MENUITEM "Item 3" ACTION MsgInfo( "Item_3" ) MENUITEM "Item 4" ACTION MsgInfo( "Item_4" ) SEPARATOR MENUITEM "Item 5" ACTION MsgInfo( "Item_5" ) MENU MENUITEM "Item 51" ACTION MsgInfo( "Item_51" ) MENUITEM "Item 52" ACTION MsgInfo( "Item_52" ) SEPARATOR MENUITEM "Item 53" ACTION MsgInfo( "Item_53" ) MENUITEM "Item 54" ACTION MsgInfo( "Item_54" ) MENUITEM "Item 55" ACTION MsgInfo( "Item_55" ) ENDMENU MENUITEM "Item 6" ACTION MsgInfo( "Item_6" ) MENUITEM "Item 7" ACTION MsgInfo( "Item_7" ) ENDMENU MENUITEM "Salir" MENU MENUITEM "Abandonar Test" ACTION oWnd:End() SEPARATOR MENUITEM "Historico" MENUITEM "Simbolo Sistema" ENDMENU ENDMENU Return oMnu //----------------------------------------------------------------------------// Abs Quote Link to comment Share on other sites More sharing options...
kapiaba Posted December 10, 2021 Report Share Posted December 10, 2021 #define HKEY_LOCAL_MACHINE 2147483650 // 0x80000002 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 Abs. Quote Link to comment Share on other sites More sharing options...
sygecom Posted December 10, 2021 Report Share Posted December 10, 2021 FUNCTION WIN32_64BITS if ISWOW64() ShowMsg( "Windows 64 bits" ) else ShowMsg( "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 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted December 11, 2021 Report Share Posted December 11, 2021 Dears, e assim, o que retorna? #Include "FiveWin.ch" FUNCTION WIN32_64BITS IF ISWOW64() MsgInfo( "Windows 64 bits", cWinVersion() ) ELSE MsgInfo( "Windows 32 bits", cWinVersion() ) 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 Abs. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.