Description: This function returns the Windows™ default printer.
Returns: Handle
Usage: Script
Format: DefaultPrinter()
Parameters: None
Comments: This function is used primarily in conjunction with the Redirect statement, which permanently redirects the resources of the system. The only way to return to the original default printer without knowing its source in advance is by using this function as illustrated in the "Example" section.
Example:
If MatchKeys(2, "p") { When letter "p" is pressed };
[
str1 = DefaultPrinter() { Store the default printer };
Redirect("DEF:", newPrinter) { Select different printer };
PrtScrn() { Output screen to printer };
Redirect("DEF:", str1) { Restore original printer };
]
In this script, the default printer is saved before redirecting printing to another printer. This allows the original printer to be restored as the default when the custom printing is concluded.
See Also: