>>So, question #1: how do I get the printer properties from the hDC? I may just let the dialog set the windows default printer (as the printer doesn't change for VFP if I don't) and then restore it when I'm done, but that's ugly.
>>
>>Question #2: how can I filter out the printers it shows? It shows ALL the printers, and I want to kick out any of them that have "PDF" in the name. Or at least can I have a dialog that shows the printer setup for just one given printer name, without the ability to select a printer? Then I'd have a combo with a (filtered) selection elsewhere.
>
>Dragan,
>
>Maybe not the answer you're after, but still
>
>(1) Why not make a ListBox class (rowsourcetype 0) which you populate with selected printers from aprinters()
That's plan A or plan B - I've changed them so many times in the last two days :).
>(2) per printer in aprinters
>- skip ports a la RPT?: (RedMon port redirector)
>- skip ports a la FILE:
>- find the printerdriver for the printer, skip it if you find the driver suspicous (or even if ADOBE $ upper(printerdriver))
Your code gave me lot of hope, but I couldn't get it to work. No matter what I gave it as printer names, the first function always returned a zero, and the by ref parameters also stayed blank.
I tried calling GetPrinterDriver() with a .hdc (also the so-called "information context", whatever that is) for first parameter, but no cigar either.