Help a dumb and confused newbie.
If I use VBScript or even VBA, I can edit the registry by Creating the Windows Scripting Host Shell Object and then using simple commands like RegWrite or RegDelete:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite ...
However, as best I can tell, this is not an option for VB6. To edit the registry using VB6, I need to:
1) Declare each editing function from advapi32.dll separately (e.g., Declare Function RegSetValueEx...)
2) Declare each parameter I might use with a given function (e.g., hkey, ipValueName)
3) Declare a Type for each parameter (e.g., As Long).
4) Define Constants for the hives and data values (e.g., Const REG_SZ = 1)
5) Define Constants for registry permisions (e.g., Const KEY_WRITE = &H20006)
Then, I can use VB6 to edit the registry. Is this a correct assumption??
Is there no way to invoke the Windows Scripting Host Shell Object in VB6 like I can in VBS and VBA?
Also, can I stick ALL the Declarations and Constants I need to edit the registry in single ".bas" module, and then 'refer to' or 'call on' this module each time I want to have a VB6 program edit the registry?
Please respond as you would to an eight year old. Some people have said I frequently act that old anyway! ;-] THANK YOU.
VBS/VBA/VB and registry editing...
I have multiple projects planned... now how many will really get done, that is another story. 
I found out I actually CAN use the WshShell object to edit the registry in VB6. The code should be this instead:
Set WshShell = CreateObject("WScript.Shell")
WshShell.RegWrite ...
I simply don't put the WScript. before the CreateObject.
I found out I actually CAN use the WshShell object to edit the registry in VB6. The code should be this instead:
Set WshShell = CreateObject("WScript.Shell")
WshShell.RegWrite ...
I simply don't put the WScript. before the CreateObject.