leo@lhsistemas.com Posted March 11, 2015 Report Share Posted March 11, 2015 Como acessar a chave do registro define HKEY_LOCAL_MACHINE no windows 8 ou 8.1 Para XP e Windows 7 roda legal. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted March 11, 2015 Report Share Posted March 11, 2015 Qual o intuito? Veja se ajuda: http://fivetechsoft.com/wiki/doku.php?id=fivewin_class_treg32&rev=1268223683 abs Quote Link to comment Share on other sites More sharing options...
leo@lhsistemas.com Posted March 11, 2015 Author Report Share Posted March 11, 2015 Kapiaba, boa tarde. #define HKEY_LOCAL_MACHINE 2147483650 Mas quando vou acessar ele não encontra O intuito é pegar o UTC/GMT, pois, tenho uma aplicação em FW nativo(16 bits). Quote Link to comment Share on other sites More sharing options...
kapiaba Posted March 11, 2015 Report Share Posted March 11, 2015 Kapiaba, boa tarde. #define HKEY_LOCAL_MACHINE 2147483650 Mas quando vou acessar ele não encontra O intuito é pegar o UTC/GMT, pois, tenho uma aplicação em FW nativo(16 bits). Infelizmente os novos rWindows, não permitem. pelo menos nunca consegui. abs. Quote Link to comment Share on other sites More sharing options...
aferra Posted March 12, 2015 Report Share Posted March 12, 2015 Tente assim, eu coloco no fivewin.ch #ifndef __XPP__ #define HKEY_CLASSES_ROOT 2147483648 #define HKEY_CURRENT_USER 2147483649 #define HKEY_LOCAL_MACHINE 2147483650 #define HKEY_USERS 2147483651 #define HKEY_PERFORMANCE_DATA 2147483652 #define HKEY_CURRENT_CONFIG 2147483653 #define HKEY_DYN_DATA 2147483654 #else #define HKEY_CLASSES_ROOT 1 #define HKEY_CURRENT_USER 2 #define HKEY_LOCAL_MACHINE 3 #define HKEY_USERS 4 #define HKEY_PERFORMANCE_DATA 5 #define HKEY_CURRENT_CONFIG 6 #define HKEY_DYN_DATA 7 #endif Quote Link to comment Share on other sites More sharing options...
kapiaba Posted March 12, 2015 Report Share Posted March 12, 2015 Tente assim, eu coloco no fivewin.ch #ifndef __XPP__ #define HKEY_CLASSES_ROOT 2147483648 #define HKEY_CURRENT_USER 2147483649 #define HKEY_LOCAL_MACHINE 2147483650 #define HKEY_USERS 2147483651 #define HKEY_PERFORMANCE_DATA 2147483652 #define HKEY_CURRENT_CONFIG 2147483653 #define HKEY_DYN_DATA 2147483654 #else #define HKEY_CLASSES_ROOT 1 #define HKEY_CURRENT_USER 2 #define HKEY_LOCAL_MACHINE 3 #define HKEY_USERS 4 #define HKEY_PERFORMANCE_DATA 5 #define HKEY_CURRENT_CONFIG 6 #define HKEY_DYN_DATA 7 #endif Quero ver é você pegar o UTC Aferra. kkkkkkkkkkkkkkkkkkkk Quote Link to comment Share on other sites More sharing options...
aferra Posted March 12, 2015 Report Share Posted March 12, 2015 qual o caminho desse negocio...vamos lá, me passe onde encontro isso dentro do regedit é esse? HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation Quote Link to comment Share on other sites More sharing options...
leo@lhsistemas.com Posted March 12, 2015 Author Report Share Posted March 12, 2015 Aferra, bom dia. Segue exemplo abaixo: ************************************************** Function main() Msginfo(_timezone()) return(NIL) ************************************************** Function _TimeZone()Local cUTC := "",oReg,nValor#ifndef __XPP__ #define HKEY_CLASSES_ROOT 2147483648 #define HKEY_CURRENT_USER 2147483649 #define HKEY_LOCAL_MACHINE 2147483650 #define HKEY_USERS 2147483651 #define HKEY_PERFORMANCE_DATA 2147483652 #define HKEY_CURRENT_CONFIG 2147483653 #define HKEY_DYN_DATA 2147483654#else #define HKEY_CLASSES_ROOT 1 #define HKEY_CURRENT_USER 2 #define HKEY_LOCAL_MACHINE 3 #define HKEY_USERS 4 #define HKEY_PERFORMANCE_DATA 5 #define HKEY_CURRENT_CONFIG 6 #define HKEY_DYN_DATA 7#endif#ifdef __XHARBOUR__ cUTC := Left(Alltrim(Str(TimeZone())),1)+StrZero(Val(SubStr(Alltrim(Str(TimeZone())),2)),2)+":00"#endif // SE HOUVE FALHA NA FUNCAO ACIMA, EXECUTA NA MAO A LEITURA DO REGISTRO // If Val(Left(cUTC,3)) = 0 // WINDOWS 8/8.1 NAO CONSEGUI LER // oReg := TReg32():New(HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Control\TimeZoneInformation", .f. ) nValor := oReg:Get( "Bias", 0 ) nValor := Round( nValor / 60, 0 ) * -1 oReg:Close() cUTC := Left(Alltrim(Str(nValor)),1)+StrZero(Val(SubStr(Alltrim(Str(nValor)),2)),2)+":00"EndIfReturn(cUTC) Quote Link to comment Share on other sites More sharing options...
kapiaba Posted March 12, 2015 Report Share Posted March 12, 2015 Em rWindows 7 de 32 bits, funciona de boa. #include "FiveWin.ch" #include "struct.ch" #ifndef __XPP__ #define HKEY_CLASSES_ROOT 2147483648 #define HKEY_CURRENT_USER 2147483649 #define HKEY_LOCAL_MACHINE 2147483650 #define HKEY_USERS 2147483651 #define HKEY_PERFORMANCE_DATA 2147483652 #define HKEY_CURRENT_CONFIG 2147483653 #define HKEY_DYN_DATA 2147483654 #else #define HKEY_CLASSES_ROOT 1 #define HKEY_CURRENT_USER 2 #define HKEY_LOCAL_MACHINE 3 #define HKEY_USERS 4 #define HKEY_PERFORMANCE_DATA 5 #define HKEY_CURRENT_CONFIG 6 #define HKEY_DYN_DATA 7 #endif FUNCTION Main() PRIV nTimez nTimez := TimeZone() ? nTimez RETURN NIL FUNCTION TimeZOne() LOCAL oReg, cUtc oReg := TReg32():New(HKEY_LOCAL_MACHINE,"SYSTEM\CurrentControlSet\Control\TimeZoneInformation",.f.) nTimez := oReg:Get( "Bias", 0 ) nTimez := Round( nTimez / 60, 0 ) * -1 cUTC := Left(Alltrim(Str(nTimez)),1)+StrZero(Val(SubStr(Alltrim(Str(nTimez)),2)),2)+":00" nTimez := cUtc oReg:Close() RETURN( nTimez ) //-> FIM DO PROGRAMA Abs aferra 1 Quote Link to comment Share on other sites More sharing options...
aferra Posted March 12, 2015 Report Share Posted March 12, 2015 bueno, talvez o problema seja com o 16 bits sei lá com win 8 e 8.1 foi de boa oReg := TReg32():New( HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Control\TimeZoneInformation" ) ?nValor := oReg:Get( "Bias", 0 ) // RETORNO 180 ?nValor := Round( nValor / 60, 0 ) * -1 // RETORNO -3 oReg:Close() Quote Link to comment Share on other sites More sharing options...
Theotokos Posted March 18, 2015 Report Share Posted March 18, 2015 Uma duvida... algo estranho... Fw nativo 16 bits funciona no Windows 8 ? não teria que ser 32 ou 64 bits? Quote Link to comment Share on other sites More sharing options...
aferra Posted March 18, 2015 Report Share Posted March 18, 2015 Bom tenho o programa em 16 bits e roda em qualquer windows 32 bits, 64 bits não dá kapiaba 1 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted March 18, 2015 Report Share Posted March 18, 2015 16 bits em 64 bits, não podyyyyyyyy, né <Aferra>? kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk, abs. aferra and Theotokos 2 Quote Link to comment Share on other sites More sharing options...
aferra Posted March 18, 2015 Report Share Posted March 18, 2015 a Regra é Clara, isso não poooooodddyyyyyyyyyyyyyyy, kkkkkkkkkkkkkkkkkkkkkkkkkk Theotokos and kapiaba 2 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.