April 27, 2024, 06:31:51 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Registry Viewer and Editor

Started by Andy, March 25, 2014, 01:42:30 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

Hi,

This is something i've wanted to have a go at for some time, well here it is.

Firstly a warning!
Do not use this program if you do not understand the Windows registry
You should always make a backup copy of the registry and create a restore point first

I would suggest you open the windows registry, create a sub key of your own in HKEY_CURRENT_USER,
I use a sub key called "KMS".
Then add some values to the key, and add a couple of sub keys to it as well for good measure



That said, this is what you can do:

1. View the registry / Sub keys and their entries
2. Add / Edit / Delete entries for a key (String and Dword ONLY)
3. Sort entries alphabetically
4. Add / Delete Keys

How to use:

1. Double click on the word "Computer".
2. Double click on either

    HKEY_CLASSES_ROOT
    HKEY_CURRENT_USER
    HKEY_LOCAL_MACHINE
    HKEY_USERS
    HKEY_CURRENT_CONFIG

    (I suggest HKEY_CURRENT_USER)

3. Double click on a key that starts with a "+" sign - the sub key will open and display it's sub keys
4. When you get to a sub key without a "+" sign, click on it to display the entries.

I think the rest is straight forward.

Finally, just to cover me - use this at your own risk - that said I have had no problems, but think before you edit or delete something!

How to complie:
Change line 6 - $include "C:\\KMS\\C3\\KMS.inc" to the location you saved the KMS.INC file.

Thanks,
Andy.
:) 

Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Brian

Andy,
Can't get it to compile. Put the KMS.inc file into the include folder, get these errors:
Compiling...
Tree4.iwb
File: C:\Program Files (x86)\iwbdev\include\KMS.inc (103) Error: duplicate declaration of RegGetValue
File: C:\Program Files (x86)\iwbdev\include\winreg.inc (250) Warning: See previous declaration
File: C:\Program Files (x86)\iwbdev\include\KMS.inc (153) Error: duplicate declaration of RegDeleteValue
File: C:\Program Files (x86)\iwbdev\include\winreg.inc (233) Warning: See previous declaration
File: C:\Program Files (x86)\iwbdev\include\KMS.inc (172) Error: duplicate declaration of RegSetValue
File: C:\Program Files (x86)\iwbdev\include\winreg.inc (247) Warning: See previous declaration
File: C:\Program Files (x86)\iwbdev\include\KMS.inc (260) Error: duplicate declaration of RegCreateKey
File: C:\Program Files (x86)\iwbdev\include\winreg.inc (229) Warning: See previous declaration
File: C:\Program Files (x86)\iwbdev\include\KMS.inc (273) Error: duplicate declaration of RegDeleteKey
Error(s) in compiling "C:\Users\Public\Documents\IWBasic\projects\Registry Editor\Tree4.iwb"

If I comment out the KMS.inc file, I only get the one error:
Compiling...
Tree4.iwb
File: C:\Users\Public\Documents\IWBasic\projects\Registry Editor\Tree4.iwb (156) Error: Undefined function RegCountSubKeys
Error(s) in compiling "C:\Users\Public\Documents\IWBasic\projects\Registry Editor\Tree4.iwb"

Only seems to happen to me . . .

Brian

LarryMc

you're not the only one.  The last version I helped with I had to change a buch of stuff to get it to compile for the same reason.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

Hi Guys,

Yes I see your problem, this is what you need to do:

In the source code (Tree.iwb) add the line:
$define __winreg_inc__  (before the $include "windowssdk.inc" line in the program).

Find $include "winreg.inc" in the windowssdk.inc include file and change it to:

$ifndef __winreg_inc__
      $include "winreg.inc"
$endif


(If it's not already defined that way).

My modification was to simply comment out the $include "winreg.inc" in the windowssdk.inc - but this is the "better" way of doing it.

Winreg.inc doesn't have all the registry functions in it that I use - RegEnnumKey for example.

Sorry for the confusion, my mod was done in EB and then IWB a good while ago.

Finally,
Attached is a more up to date version - found a few little discreponcies in displaying entry values (now hopefully fixed).

Thanks,
Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

LarryMc

I suggest you NEVER suggest modifying Sapero's windowssdk.inc file(or any it includes)  to make a specific program run.
Although in this case there is probably no harm/no foul but in other cases in can break other programs.

The proper way to fix this, in my opinion, is first to make sure you have the latest version of Sapero's windowssdk.inc installed on your computer.
The way to do that is to download and reinstall it if you  are not sure.

Here's my problem with the code.
first, this is with the understanding that when we post code we have to expect people to use parts or all in their own creations.

The KMS.inc file contains 15 subroutines.
9 of those 15 subroutines redefine(have the same name) as registry subroutines defined in the windowssdk.inc file.
On top of that the 9 subroutines change the number and/or type of the past parameters.
Of the remaining 6 subroutines, most create duplicate definition errors.

That automatically causes the compiler to spit out duplicate definition and mismatched parameters if the user is using the windowssdk.inc in what I call the standard way.

In the attached files I have renamed all the subroutines that have API names by prepending an "a" to the sub name.
I've made all the changes in the code so the new names work.
I've gotten rid of all the other duplicate definitions in the KMS file.
Also got rid of all those unused variables that were causing warnings.

Now, the source file will compile without errors or warnings.

And the source code(or pieces thereof) can be safely used in other applications without running into naming or parameter errors  with windowssdk.inc.

@andy - you should test to make sure I didn't break anything.

LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

Hi Larry,

Re:
I suggest you NEVER suggest modifying Sapero's windowssdk.inc file(or any it includes)  to make a specific program run.
Although in this case there is probably no harm/no foul but in other cases in can break other programs.

It was Sapero's suggestion to do this in the first place- not me.

The KMS.inc file contains 15 subroutines.
9 of those 15 subroutines redefine(have the same name) as registry subroutines defined in the windowssdk.inc file.
On top of that the 9 subroutines change the number and/or type of the past parameters.
Of the remaining 6 subroutines, most create duplicate definition errors.


I did not write this .inc file just renamed it to suit me and my projects.

I will of course test your mod and let you know how it goes.

I always want to share for the common good of IWB not do any harm.


Andy.



Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

LarryMc

I know you weren't trying to do any harm.

As for Sapero, although the help he has provided me and others is priceless. that doesn't mean he and I always agreed.
While he was working on IWB2.0 he and I had several disagreements.  He wanted to make some stuff almost rocket science and I wanted to go by the KISS principle(Keep It Simple Stupid)  which is the beauty of IWB.

He created all those include files that are a part of windowssdk.inc
He knew those include files like the back of his hand.

If he told you to do it the way he did it was because he knew his way wouldn't cause YOU any problems.
(And why I said no harm/no foul in this case.)

My point is that I'd bet no one else who uses windowssdk has studied how all those include files are put together.
Therefore I would never suggest that anyone ever modify them.

The other point is that, again in my opinion, it is never a good idea to name user created subroutines with the same names as API functions.

Your right about it being your program and you can write it in any manner you chose.
You can leave it up to any potential users to sort out any problems your coding style may cause them; and that's okay.
But that just happens to not be my style.

And, probably the most important thing  I can say is that it's okay to tell to "go to hell" or "shut up". ;D ;D ;D ;D ;D ;D ;D

When you get down to it I'm just another member here like everyone else and not the guru/dictator I may come across as.
I'm just a tenacious amateur with a limited skill set that likes to program and try to help people.
I'm also an old fart who isn't going to change his ways. ;)

I appreciate you posting your creation for others to benefit/learn from.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

Larry,

I can assure you there was no offence taken at all  :)

And as said before I always appreciate yours / and anyone elses help greatly!!

Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.