|Top Previous Next|
Win2PDF looks for registry values at the following locations and in the following order:
"HKEY_CURRENT_USER\Software\VB and VBA Program Settings\Dane Prairie Systems\Win2PDF"
"HKEY_CURRENT_USER\Software\Dane Prairie Systems\Win2PDF" and
"HKEY_LOCAL_MACHINE\Software\Dane Prairie Systems\Win2PDF"
The first registry location is used for the Visual Basic "SaveSetting" function. From Visual Basic, you can call SaveSetting with the following parameters to control Win2PDF:
SaveSetting "Dane Prairie Systems", "Win2PDF", Value Name, Value
Where "ValueName" and "Value" will depend on the Win2PDF setting to control. The SaveSetting command only works with Win2PDF registry settings that use a string type.
The HKEY_CURRENT_USER registry location is useful if you want the setting to apply only to the current user. This is especially important when using Win2PDF in a multi-user environment such as Windows Terminal Services.
The HKEY_LOCAL_MACHINE location is useful if you want the setting to apply to all users, or if your application is only going to be used with a single user.
After the document is created, the registry value will be deleted by Win2PDF. If you would like the setting to apply to all documents without having to add the registry value for each document, you can create a non-zero registry value named "persistent" to one of the locations listed above. This will prevent Win2PDF from deleting the value after each document.
The following Win2PDF settings can be controlled from the registry:
If you create the any of the string registry values as a REG_EXPAND_SZ instead of a REG_SZ type, the value will be expanded from environment variables. The environment variables are specified with "%" characters at the beginning and end of the variables as in "%HOMEPATH%". The REG_EXPAND_SZ option is not available from the Visual Basic SaveSetting command. The %DATE% and %TIME% environment variables are not expanded by this option.
The registry methods are not safe when used with programs that have multiple threads or multiple processes that access Win2PDF. For these types of programs, you need to ensure that only one thread or process has access to Win2PDF at a time by using a Windows critical section or mutex. The Windows printer interfaces do not have these limitations.
When multiple instances of Win2PDF are installed, Win2PDF first looks in the registry locations based on the instance name of Win2PDF. This allows separate settings for different instance of Win2PDF. For example, if the current instance of Win2PDF is named "Win2PDF (Copy 1)" the following registry locations would be checked before the standard registry locations:
"HKEY_CURRENT_USER\Software\VB and VBA Program Settings\Dane Prairie Systems\Win2PDF (Copy 1)"
"HKEY_CURRENT_USER\Software\Dane Prairie Systems\Win2PDF (Copy 1)" and
"HKEY_LOCAL_MACHINE\Software\Dane Prairie Systems\Win2PDF (Copy 1)"
If a setting doesn't exist under the instance name section of the registry, then Win2PDF checks the standard locations.