I do not know what I am doing wrong. I have got Enumerating sub-keys with success values in FMG_Editor, but I can not get the same result with this one:
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\PARALLEL PORTS
I tried with this code:
Code: Select all
Function Main()
Local cKey:="HKEY_LOCAL_MACHINE"
Local cSubKey:="HARDWARE\DEVICEMAP\PARALLEL PORTS"
Local aPorts:=EnumKeys( HKEY_LOCAL_MACHINE, cKey, cSubKey )
msgdebug(aPorts) // I wish to get this sub-key value in \Device\Parallel0
Return Nil
Function EnumKeys(nKey,cKey,cSubKey)
Local hKey, cBuffer, n := 0, aRet:={}
#define KEY_READ 0x20019
If RegOpenKeyEx ( nKey, cSubKey, KEY_READ, @hKey )
Do While RegEnumKeyEx ( hKey, n++, @cBuffer )
AAdd(aRet,cBuffer)
Enddo
RegCloseKey( nKey )
Endif
Return aRet
MsgDebug(RegistryRead("HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\PARALLEL PORTS\Device\Parallel0"))
And
MsgDebug(RegistryRead("HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\PARALLEL PORTS:\Device\Parallel0"))
But with no success. I saw some C examples, probably could help to understand better:
http://read.pudn.com/downloads3/sourcec ... ts.c__.htm (find for: m_szRegParallelMap)
http://www-user.tu-chemnitz.de/~heha/vi ... PP&lang=de (find for: DEVICEMAP\\PARALLEL PORTS)
I need to get if exists LPT1, LPT2...

Sometimes in some PC there is a multi/IO card installed which can assume LPT1 as LPT3, or LPT2... so I need to know first LPT available in the each PC.