urgent for Antonio.
appeal to the problem in Returning the information from the Registrar
:?:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run.
I want the information in the Registrar Run.
function REGQUERYVALUE() not ready
hathal .
function REGQUERYVALUE() not ready
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Hathal,
You have to do it this way:
And add this function to source\winapi\regedit.c:
Please notice that the above function is not complete yet, though it works fine for the above sample
You have to do it this way:
Code: Select all
#define HKEY_LOCAL_MACHINE 2147483650
#define ERROR_SUCCESS 0
function Main()
local hKey, cName, uValue, n := 0
RegOpenKey( HKEY_LOCAL_MACHINE,;
"Software\Microsoft\Windows\CurrentVersion\Run", @hKey )
while RegEnumValue( hKey, n++, @cName, @uValue ) == ERROR_SUCCESS
MsgInfo( cName )
MsgInfo( uValue )
end
RegCloseKey( hKey )
return nil
Code: Select all
#ifdef __HARBOUR__
CLIPPER REGENUMVALUE( PARAMS ) // ( nKey, nIndex, @cKeyName, @uValue ) --> nResult
#else
CLIPPER REGENUMVAL( PARAMS ) // UE( nKey, nIndex, @cKeyName, @uValue ) --> nResult
#endif
{
BYTE name[ 256 ];
BYTE value[ 256 ];
LONG lName, lValue;
DWORD type;
_retnl( RegEnumValue( ( HKEY ) _parnl( 1 ), _parnl( 2 ), ( char * ) name, &lName,
NULL, &type, ( char * ) value, &lValue ) );
_storc( ( char * ) name, 3 );
switch( type )
{
case REG_SZ:
_storc( ( char * ) value, 4 );
break;
case REG_DWORD:
_stornl( * ( ( LPDWORD ) value ), 4 );
break;
}
}
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- HATHAL
- Posts: 77
- Joined: Tue Nov 15, 2005 3:38 pm
- Location: The Kingdom Saudi Arabia -Riyadh
- Contact:
Thank Antonio for help me.
I am working on Borland c source did not work with me in the required way.
But adjusted and became 100% see the source after the amendment.
Thank you.
hathal.
// --------- source --------------------------------------
#include "FiveWin.ch"
#include "Struct.ch"
#define HKEY_LOCAL_MACHINE 2147483650
#define ERROR_SUCCESS 0
#define HKEY_CURRENT_USER 2147483649 // 0x80000001
function Main()
local hKey, cName:="", uValue:="", na_reg := 0
RegOpenKey( HKEY_LOCAL_MACHINE,;
"Software\Microsoft\Windows\CurrentVersion\Run", @hKey )
while RegEnumValue( hKey,na_reg++, @cName, @uValue ) == ERROR_SUCCESS
MsgInfo( cName,na_reg )
MsgInfo( uValue )
/ end
RegCloseKey( hKey )
return nil
*********************************************************************
# pragma BEGINDUMP
#include <windows.h>
#include "hbapiitm.h"
#include "hbvm.h"
#include "hbstack.h"
#include "item.api"
#include "hbpcode.h"
#include "hbvmpub.h"
HB_FUNC ( REGENUMVALUE ) // ( nKey, nIndex, @cKeyName, @uValue ) --> nResult
{
BYTE value[1024 ];
TCHAR szName[1024];
DWORD dwDataSize, dwSizeName;
DWORD dwSize,dwType,dwDisp;
LPBYTE lpData = 0;
char ret_value[1024];
int ret;
hb_retnl(RegEnumValue(( HKEY ) hb_parnl( 1 ), hb_parnl( 2 ), szName, &dwSizeName, NULL, &dwType,lpData, &dwDataSize));
RegQueryValueEx(( HKEY ) hb_parnl( 1 ),szName , NULL, &dwType, (unsigned char*)&ret_value, &dwSize);
hb_storc( ( char * ) szName, 3 );
// MessageBox(NULL,ret_value,"ret_value",MB_ICONQUESTION|MB_SYSTEMMODAL|MB_APPLMODAL|MB_TASKMODAL|MB_SETFOREGROUND|MB_TOPMOST|MB_YESNO);
switch( dwType )
{
case REG_SZ:
strcpy(value,ret_value);
hb_storc( ( char * ) value, 4 );
break;
case REG_DWORD:
ret =*(( LPDWORD ) ret_value);
hb_stornl( ( int ) ret , 4 );
break;
/*
REG_MULTI_SZ:
REG_EXPAND_SZ:
REG_BINARY:
REG_FULL_RESOURCE_DESCRIPTOR:
*/
}
}
#pragma ENDDUMP
// -----------------------------------------------
I am working on Borland c source did not work with me in the required way.
But adjusted and became 100% see the source after the amendment.
Thank you.
hathal.
// --------- source --------------------------------------
#include "FiveWin.ch"
#include "Struct.ch"
#define HKEY_LOCAL_MACHINE 2147483650
#define ERROR_SUCCESS 0
#define HKEY_CURRENT_USER 2147483649 // 0x80000001
function Main()
local hKey, cName:="", uValue:="", na_reg := 0
RegOpenKey( HKEY_LOCAL_MACHINE,;
"Software\Microsoft\Windows\CurrentVersion\Run", @hKey )
while RegEnumValue( hKey,na_reg++, @cName, @uValue ) == ERROR_SUCCESS
MsgInfo( cName,na_reg )
MsgInfo( uValue )
/ end
RegCloseKey( hKey )
return nil
*********************************************************************
# pragma BEGINDUMP
#include <windows.h>
#include "hbapiitm.h"
#include "hbvm.h"
#include "hbstack.h"
#include "item.api"
#include "hbpcode.h"
#include "hbvmpub.h"
HB_FUNC ( REGENUMVALUE ) // ( nKey, nIndex, @cKeyName, @uValue ) --> nResult
{
BYTE value[1024 ];
TCHAR szName[1024];
DWORD dwDataSize, dwSizeName;
DWORD dwSize,dwType,dwDisp;
LPBYTE lpData = 0;
char ret_value[1024];
int ret;
hb_retnl(RegEnumValue(( HKEY ) hb_parnl( 1 ), hb_parnl( 2 ), szName, &dwSizeName, NULL, &dwType,lpData, &dwDataSize));
RegQueryValueEx(( HKEY ) hb_parnl( 1 ),szName , NULL, &dwType, (unsigned char*)&ret_value, &dwSize);
hb_storc( ( char * ) szName, 3 );
// MessageBox(NULL,ret_value,"ret_value",MB_ICONQUESTION|MB_SYSTEMMODAL|MB_APPLMODAL|MB_TASKMODAL|MB_SETFOREGROUND|MB_TOPMOST|MB_YESNO);
switch( dwType )
{
case REG_SZ:
strcpy(value,ret_value);
hb_storc( ( char * ) value, 4 );
break;
case REG_DWORD:
ret =*(( LPDWORD ) ret_value);
hb_stornl( ( int ) ret , 4 );
break;
/*
REG_MULTI_SZ:
REG_EXPAND_SZ:
REG_BINARY:
REG_FULL_RESOURCE_DESCRIPTOR:
*/
}
}
#pragma ENDDUMP
// -----------------------------------------------