First, if you don't know what the registry is, or it's purpose, press your browser's Back button.
Today I made a little userlibrary to those who wants it, which gives Blitz possibilities to write and read to/from the registry.
Features:
Reg_ReadInt%( RootKey$, Path$, Name$)
Reg_ReadString$( RootKey$, Path$, Name$)
Reg_ReadFloat#( RootKey$, Path$, Name$)
Reg_WriteInt%( RootKey$, Path$, Name$, Data%)
Reg_WriteString%( RootKey$, Path$, Name$, Data$)
Reg_WriteFloat%( RootKey$, Path$, Name$, Data#)
Reg_WriteBinaryData%( RootKey$, Path$, Name$, BankSize%, Bank)
Reg_KeyExists%( RootKey$, Path$)
Reg_ValueExists%( RootKey$, Path$, Name$)
Reg_DeleteKey%( RootKey$, Path$)
Reg_DeleteValue%( RootKey$, Path$, Name$)
I would recommend that you backup your own registry if you're not familiar with programming in it before starting (however, I must admit that I have never backuped the registry. Not even when I made and tested this DLL).
Download it here (dll and .decls file)
If the link doesn't work, use _ttp://chrml.thefreebizhost.com/reg.zip (ofcourse you must replace "_" with "h").
Use it as you wish!
Usage: Install: Put .dll, and .decls file into the /userlibs folder, and restart Blitz.
Parameters: Every "Rootkey$" parameter is the full name of the root ("HKEY_LOCAL_MACHINE", "HKEY_CURRENT_USER", and so on...). The "Path$" parameter is the path to the key (ie. "SOFTWARE\MyCompany\MyApplicationName"). The "Name$" parameter is always the name of a the value inside a key. Data is always what you want to write. About "Reg_WriteBinaryData", use the banks with care. The Bank parameter there is a Blitz bank created with CreateBank (a buffer as we call it). Remember to use a correct BankSize that is equals or is less than the size of the Bank (defined in CreateBank). Passing a bigger may cause unexpected results.
Return values: All commands return 1 (True) if success, or 0 (False) on failure.
Disclaimer: Reg.dll is bugfree (with 1.87 atleast), and if used properly it can't do any damage to the registry, however, that does not mean that the Blitz program that uses reg.dll can't damage it. If you find reg.dll in the same dir as a Blitz program that destroyed your Windows, then I'm not the person to be held responsible for that (as it's the Blitz programmer that uses the library that need to know what he shouldn't do to a users registry).
|