Rewritten February 2018
? tab(-10, AG_WINPTR); chr(127);
input line "", params$
AG_WINPTR (56) brings up the Windows printer selection dialog, returning a string containing four or more comma-delimited parameters depending on the circumstances and user response, i.e.:
status, ptrname$, port$, dvr$ {, orientation, length, width, form, duplex, bin, color, quality}
As an example, selecting the PDF-XChange Printer 2012 will return something like:
1,PDF-XChange Printer 2012,PDF-XChange5,winspool,1,0,0,Letter/ANSI A,0,0,2,300
The first parameter, status, will be 1 if the user selected a printer, else 0
See MX_WINPTR for the definitions of the remaining parameters.
Note that since ATE and A-Shell/Windows versions prior to 6.0.1248.0 will only return the first four fields, and that INPUT will continue to prompt for parameters that were not supplied. It is therefore best to input the entire string as a single line, as shown above, and then parse it out, perhaps using INSTR() or STRTOK.SBR Using MX_WINPTR will take care of all the parsing automatically.
History
2012 April, A-Shell 6.0.1248: Added all parameters after "PTRDVR$"