Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Description of API in win32API
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00272307
Message ID:
00273860
Views:
34
>Thank you for your previous answer.
>
>I am sarching an API to change the default printer setting programmaticaly.
>
>Do you know if such an API exists.
>
>
>Thank you for your answer.

Hi Francis,

You'd have to use the following API calls: OpenPrinter(), GetPrinter(), SetPrinter() and ClosePrinter() if doing this strictly in VFP. It really depends on what properties you're trying to set. If they're in a PRINTER_INFO_2 structure's DEVMODE structure, it's complicated since one of the members of the PRINTER_INFO_2 structure is a pointer to the DEVMODE structure. If sticking with VFP, you'd need Vlad Tatavu's Pointers, Ed Rauh's CLSHEAP, or Christof Lange's Structure (from the UT download section) to be able to create the pointer to the DEVMODE.

It'd probably be easier to write a VC++ DLL to wrap this.

Anyway, there's an MS KB article (Q140285) that tell's how to do this from C++.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform