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
// -----------------------------------------------