User Tools

Site Tools


simple_20registry_20usage

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

simple_20registry_20usage [2018/03/31 13:19]
127.0.0.1 external edit
simple_20registry_20usage [2018/04/17 18:44] (current)
tbest3112 Added syntax highlighting
Line 2: Line 2:
  
 //By JGH, Feb-2007.//​\\ \\  The registry is a repository of data maintained by Windows, which holds various information. An application can store configuration or other information from one session to the next within the HKCU/​Software/​MyPublisher/​MyApplication part of the registry, where //​MyPublisher//​ and //​MyApplication//​ are set appropriately.\\ \\  The registry can store various types of data, such as strings, integers, multiple strings, binaries, but you can do simple registry access if you just use string entries.\\ \\  An example program //​FredProg//​ from //​BloggSoft//​ can read settings using code similar to the following:​\\ \\  //By JGH, Feb-2007.//​\\ \\  The registry is a repository of data maintained by Windows, which holds various information. An application can store configuration or other information from one session to the next within the HKCU/​Software/​MyPublisher/​MyApplication part of the registry, where //​MyPublisher//​ and //​MyApplication//​ are set appropriately.\\ \\  The registry can store various types of data, such as strings, integers, multiple strings, binaries, but you can do simple registry access if you just use string entries.\\ \\  An example program //​FredProg//​ from //​BloggSoft//​ can read settings using code similar to the following:​\\ \\ 
 +<code bb4w>
         KeyRoot$="​Software\BloggSoft\FredProg\"​         KeyRoot$="​Software\BloggSoft\FredProg\"​
  
         LastSaved$=FNReg_Rd(KeyRoot$+"​LastSaved"​)         LastSaved$=FNReg_Rd(KeyRoot$+"​LastSaved"​)
         LoadPath$ =FNReg_Rd(KeyRoot$+"​LoadPath"​)         LoadPath$ =FNReg_Rd(KeyRoot$+"​LoadPath"​)
 +</​code>​
 \\  It can later update the registry entries using the following code:\\ \\  \\  It can later update the registry entries using the following code:\\ \\ 
 +<code bb4w>
         KeyRoot$="​Software\BloggSoft\FredProg\"​         KeyRoot$="​Software\BloggSoft\FredProg\"​
  
         PROCReg_Wr(KeyRoot$+"​LastSaved",​LastSave$)         PROCReg_Wr(KeyRoot$+"​LastSaved",​LastSave$)
         PROCReg_Wr(KeyRoot$+"​LoadPath",​LoadPath$)         PROCReg_Wr(KeyRoot$+"​LoadPath",​LoadPath$)
 +</​code>​
 \\  You should ensure **KeyRoot$** is formed in the above format to ensure consistency and to ensure the registry names are unique to your application.\\ \\  The example code uses the **Reg_Rd()** and **Reg_Wr()** functions in the [[http://​mdfs.net/​System/​Library/​BLib/​Win/​|Reg]] BASIC library, and listed here:\\ \\  \\  You should ensure **KeyRoot$** is formed in the above format to ensure consistency and to ensure the registry names are unique to your application.\\ \\  The example code uses the **Reg_Rd()** and **Reg_Wr()** functions in the [[http://​mdfs.net/​System/​Library/​BLib/​Win/​|Reg]] BASIC library, and listed here:\\ \\ 
 +<code bb4w>
         DEF FNReg_Rd(Key$)         DEF FNReg_Rd(Key$)
         LOCAL K%,​R%,​L%,​T%,​B%,​Item$,​Value$         LOCAL K%,​R%,​L%,​T%,​B%,​Item$,​Value$
Line 35: Line 40:
         ENDIF         ENDIF
         ENDPROC         ENDPROC
 +</​code>​
simple_20registry_20usage.txt ยท Last modified: 2018/04/17 18:44 by tbest3112