Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

JumpTo RegEdit

0.00/5 (No votes)
9 Jul 2012 2  
This is an alternative for JumpTo RegEdit

Introduction

This is just an alternate (VB.Net) version of "JumpTo RegEdit" located here: http://www.codeproject.com/Articles/20283/JumpTo-RegEdit

This version is updated to VS 2008 and then Converted to VB.NET using the online code converter from here http://converter.telerik.com/

Background

I have been looking for a way to add the Reg Jump in VB.NET for several of my programs so I converted the C# code to VB.NET.

Using the code

The complete test project is in the download zip file.

There have been very few changes to the code from the original article besides the conversion to VB.Net.

Some of the lines converted from C# converterd to DirectCast and had a type conversion error so I changed them CType and it works fine.

C# code:

return Marshal.PtrToStringUni((IntPtr)(lpLocalBuffer.ToInt32() + Marshal.SizeOf(typeof(Interop.TVITEM))));

VB.NET code:

Change this in the converted code:

'Return Marshal.PtrToStringUni(DirectCast(lpLocalBuffer.ToInt32() + Marshal.SizeOf(GetType(Interop.TVITEM)), IntPtr))

To this:

Return Marshal.PtrToStringUni(CType(lpLocalBuffer.ToInt32() + Marshal.SizeOf(GetType(Interop.TVITEM)), IntPtr))

That was just one of a few lines that needed to be converted to CType.

When run under Windows Vista with UAC enabled it throws this error.

System.InvalidOperationException was unhandled
  Message="WaitForInputIdle failed.  This could be because the process does not have a graphical interface."

But when run as Admin it does not throw the error.

I added, ="requireAdministrator"

To get around the error in case a person forgets to "Run as Administrator"

Points of Interest

This conversion helped me learn more on using hte API functions and jumping to the Registry at a given point.

I hope it helps others.

History

Initial conversion 8 July 2012

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here