README.TXT This README file contains information on the Inside the Windows 95 Registry diskette that was not available at the time the book went to press. For additional information and bug fixes, see our web page at http://www.ora.com/pub/examples/windows/win95.update/registry.html SOFTWARE REGMON.EXE The only program on the Inside the Windows 95 Registry diskette that is not compressed is RegMon. If you'd like to take a quick look at registry spying in action, you can launch it either by clicking on its lnk in the root directory of the diskette or by launching the program from the \SOFTWARE\REGMON subdirectory. WINREG.BAS WINREG.BAS, which is discussed in Appendix B, is located in the \SOFTWARE\WINREG subdirectory. It is used with permission of Microsoft Corporation, and contains slightly modified versions of information that is included with Microsoft Corporation's development tools. SAMPLES If you're interested in running the sample programs under WinNT 3.5 or 4.0 as well as under WinNT, see the compatibility table at the end of this file. OREGCLN.EXE Many of the sample programs create new keys and value entries in your registry. In a few cases in Appendix A, we've described individual value entries that you might want to delete (like the EditFlags value entry). To the best of our knowledge, the remainder of these changes should have no effect on your system. They do, however, increase the total size of your registry, and consume extra space on your hard disk. To save you from having to manually delete these keys, the \SAMPLES\OREGCLN directory contains a small utility, OREGCLN.EXE, that deletes the keys created by the sample programs. OREGCLN.EXE is written in Visual Basic, and therefore requires the VB40032.DLL to run successfully. It's been tested under Win95 as well as WinNT 3.x and WinNT 4.0. Complete source code is included. A number of the sample programs differ slightly from those shown in the book. The major difference is that some parameters have been cast to eliminate compiler warnings. Some more substantial changes have been made to the following code samples: Chapter 1 INIREG.C -- Unlike Win95, WinNT imposes no practical limit on the size of initialization files. Because of this, the registry/initialization file performance benchmark has been modified to write only about 64K to an initialization file under WinNT. In addition, since the WinNT Registry Editor does not support the generation of .REG files from the command line, this portion of the benchmark is omitted if the program runs under WinNT. Chapter 2 REGCLONE.EXE -- The program has been modified to run under WinNT. If running under NT, it checks for the operating system version to determine which top-level keys are present. In addition, the call to RegEnumKeyEx in the Form_Load procedure has been modified. In particular, the a dummy string variable has been substituted for a NULL as the value of the lpClass parameter. Under Win95, this parameter does not cause a problem, since it is completely ignored by WINREG.DLL. This isn't the case, though, under WinNT. Chapter 4 OPENKYX1.C -- The sample program that appears in Example 4-2 incorrectly interprets the dot character in a path as the dot that separates a root file name from a file extension. The version of the program on the disk corrects this error. You can launch the program from the command line using the following syntax: OPENKYX1 UNION.C -- The sample program that appears in Example 4-8 has been modified to enumerate the value entries of HKLM\Software\Microsoft\Windows\CurrentVersion if run under Win95 and of HKLM\Software\Microsoft\Windows NT\CurrentVersion if run under WinNT. MRUMENU.C and MRUMENU2.C -- Both sample programs have been modified to handle instances in which the system's recent documents MRU list is empty. In addition, they've been modified to handle the Unicode strings stored in the recent documents subkey. Chapter 5 ISWIN95.VBP is a 16-bit application that requires the 16-bit Visual Basic 4.0 run-time library, VB40016.DLL. Chapter 7 TTFONTS.VBP -- The sample program that appears in Example 7-2 has been modified to determine the platform under which it is running and to retrieve font information from WinNT as well. In WinNT, TrueType font information is stored to the value entries of HKLM\Software\Microsoft\Windows NT\CurrentVersion\Fonts. DRIVES.VBP -- In WinNT 4.0, NoDriveTypeAutoRun contains a REG_DWORD value. The program has been modified to test for the platform and to handle either the binary data stored in the Win95 registry or the long integer data stored in the WinNT 4.0 registry. Chapter 8 APP_PATH.C and APP_PATH.VBP -- The value of the samDesired parameter to RegCreateKeyEx in both the C and VB versions of this program has been changed to KEY_ALL_ACCESS to prevent security access problems under WinNT. DECRUSE.VBP -- The sample program that appears in Listing 8-6 assigns a 0 as the value of the hwnd member of the SHFILEOPSTRUCT structure. However, the SHFileOperation function appears to require a valid handle to a window even if this window is otherwise unused by the function. So a hidden form has been added to the project, and its window handle (Form1.hwnd) assigned to the hwnd member of SHFILEOPSTRUCT. In addition, the code has been modified to close the registry key before deleting it. Chapter 9 DEFSND.C -- The sizof function has been replaced with the strlen function in order for the program to run successfully under WinNT 4.0. Appendix A ISWINNT.EXE -- The program requires the 16-bit Visual Basic 4.0 run-time library (VB40016.DLL) to execute successfully; it is not included with Inside the Windows 95 Registry. COMPATIBILITY TABLE Win95 WinNT 3.5 WinNT 4.0 CHAPTER 1 inireg.exe X X X CHAPTER 2 regclone.exe X X X CHAPTER 4 openkey1.exe X X X openkyx1.exe X X X regcreax.exe X X X regconn.exe X X X compname.exe X X X brownet.exe X - *1 X enumlist.exe X - *2 X union.exe X X X mrumenu.exe X - *1 - *5 mrumenu2.exe X - *1 - *5 qmulti.exe X - *3 - *3 CHAPTER 5 chkwin95.exe X X X iswin95.exe X X X regdump.exe X X X regdmp16.exe X - *4 - *4 regdumpd.exe X - *4 - *4 CHAPTER 6 vbafunc.exe X X X getset.exe X X X getalls.exe X X X saveset.exe X X X inline1.exe X X X raiseerr.exe X X X toknown.exe X - *2 - *2 strbuff1.exe X X X getdword.exe X X X binstr2.exe X X X binstr3.exe X X X hkddrpt.exe X - *4 - *4 multisz1.exe X X X savefr1.exe X X X savefr2.exe X X X CHAPTER 7 fonts1.vbp X X X fttfonts2.vbp X X X dwregop1.vbp X X X saveset.vbp X - *1 X drives.vbp X - *1 X dwsrch3.vbp X X X valsrch1.vbp X X X CHAPTER 8 app_path.exe (C) X X X app_path.exe (VB) X X X sharetst.exe X X X sharedll.exe X X X decrtest.exe X - *1 X decruse.exe X - *1 X eflagtst.exe X X X editflg.exe X X X qv.exe X - *1 X vbqv.exe X - *1 X runonce.exe (C) X - *4 X runonce.exe (VB) X - *4 X runsrv.exe X - *4 - *4 pnptst1.exe X - *4 X edittst.exe X - *4 X vbisedit.exe X - *4 X CHAPTER 9 winpos.exe X X X vbwinpos.exe X X X defsnd.exe X - *2 X APPENDIX A platform.exe X X X getplatf.exe X X X platf16.exe X X X iswinnt.exe X X X Symbol Table: X runs under the designated platform - does not run under the designated platform n/a not tested under the designated platform Notes on Incompatibilities: *1 Requires the Windows 32-bit shell. *2 Incompatible because of differences in registry policy. *3 Function not supported by the WinNT registry API. *4 Relies on system-specific features of Windows 95. *5 Fails under WinNT 4.0 because the recent docs MRU list is stored in Unicode format; for a version of the program that works under WinNT 4.0, see our registry web page.