Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printer name from hDC printer handle?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00931585
Message ID:
00931770
Views:
31
Peter,

In effect that's what I ended up doing. Since I also needed to capture possible FromPage and ToPage choices I built a form that mimicked the PRINTER PROMPT screen. Trying to change the current printer calls GETPRINTER(). I can then save the name of the current printer, use SET PRINTER TO NAME to change the default to the one selected with GETPINTER(), and then after the print job(s) reset the default back to the original.

Originally I was hoping that doing a call to CommonDialog.ShowPrinter() would do the trick. It only takes 2 or 3 lines of code and gives feedback on FromPage, ToPage, Number of Copies, etc. Everything, it turns out, but the name of the printer that was selected. It gives you a handle to the Device Context but I never could figure out how I could use that DC handle to get the name of the printer.

Had it just returned the name of the printer that would have been the easiest way to go but the dead ends had me wasting a lot of time when I could have just built this VFP form from the beginning.

Oh well, dead ends are never a complete waste of time; I learned a lot that I wouldn't have otherwise had reason to look into.

Ed

>Can't you do a getprinter() before the first report?
>
>Peter
Previous
Reply
Map
View

Click here to load this message in the networking platform