|
-
Jun 15th, 2001, 09:50 AM
#1
Thread Starter
Junior Member
Possible to read from registry without API?
I dont want to use the getsettings functions etc. as i am trying to determine the version of office installed using the registry, and im not having much luck with the API calls...i am simply trying to determine the existance of a key. the relevent code is as follows:
Const KEY_QUERY_VALUE = &H1
Const HKEY_LOCAL_MACHINE = &H80000002
Const ERROR_SUCCESS = 0&
Private Declare Function RegOpenKeyEx Lib "AdvApi32" (ByVal Hkey As Long, ByVal lpsubkey As String, ByVal uloptions As Long, ByVal samDesired As Long, ByVal phkresult As Long) As Long
<and later down in the function to determin version:>
Success = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Office\9.0", 0, KEY_QUERY_VALUE, Presult)
If Success = ERROR_SUCCESS Then MsgBox "2000" Else MsgBox "98,97"
---------------------------------------------
The Erorr message i am getitng is :
Cant find DLL Entry Point RegOpenKeyEx in AdvApi32
Have read help contents, but havent been able to solve, all help appreciated.
-
Jun 15th, 2001, 10:16 AM
#2
Frenzied Member
Try this declaration:
VB Code:
Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long
-
Jun 15th, 2001, 02:46 PM
#3
You can't access a custom part of the registry without API. If you don't want to use API, use the SaveSetting and GetSetting functions, but they can only save in a specified path.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|