Code for restoring the registry key using RegRestorekey

Status
Not open for further replies.

samkraju

Newbie level 5
Joined
Jul 20, 2004
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
58
registry functions1

Please give me the code to restore the registry key using "RegRestorekey" API function.
 

Re: registry functions1

here's the function declaration that you need :

Code:
Public Declare Function RegRestoreKey Lib "advapi32.dll" Alias "RegRestoreKeyA" (ByVal hKey As Long, ByVal lpFile As String, ByVal dwFlags As Long) As Long

Note:
  • To deal with win32API in visual basic, just fire up VB6 API viewer. If it's not available yet, you can activate it from Add-Ins|Add-In manager menu by selecting the VB 6 API Viewer and then checking the "Load Behaviour" section as needed. Then you need to load the API declarations from within the API Viewer by using the File|Load Text File and selecting the win32API text file. The rest is pretty much intuitive.
  • After declaring the function above in the beginning of the module, you can call the corresponding function anywhre inside the module.
  • Always keep in your mind that the VB6 API viewer is your companion when dealing with win32API directly in VB.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…