Get last user selected printer
How to retrieve last user selected printer when printing from a preview window?
I tried
in OnAfterPrintReport event but it only returns the system default printer.
After the user prints the report, the program prints a few Word documents and I need to know which printer was used last.
I tried
frxReport.PrintOptions.Printer
in OnAfterPrintReport event but it only returns the system default printer.
After the user prints the report, the program prints a few Word documents and I need to know which printer was used last.
Comments
It involves hooking WH_CBT message, catching HCBT_ACTIVATE code for TfrxPrintDialog and putting an OnChange event handler to keep track of the user selected printer.