Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Current printer?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00144671
Message ID:
00144781
Views:
22
>You should be able to whip up your own printer dialog box that retains the last printer selected (using aprinter()). The dialog could easily return a value to indicate that a cancel button was pressed.
>
>FYI: The following code, along with Rick Strahl's registry class (in the files section) will get you the current Windows default printer name for comparison with the results of aprinter():
>
#DEFINE HKEY_LOCAL_MACHINE -2147483646
>
>set proc to registry.prg
>oRegistry=CREATE("Registry")
>DIMENSION taVals[1,2]
>
>lnVals=oRegistry.GetEnumValues(@taVals,HKEY_LOCAL_MACHINE,;
>	"Config\0001\System\CurrentControlSet\Control\Print\Printers")
>
>? 'Default printer is: ', taVals(1,2)
>
>
>>Does anyone have a way to determine the printer that is FoxPro's current printer?
>>I know about GETPRINTER() but I do not want to bring that up. And I know about SET('PRINTER',2), but that always returns the WINDOWS DEFAULT printer.
>>
>>Is there any way to get the VFP current printer, since it may have been changed from the WINDOWS DEFAULT?



Isn't that registry entry the same as what you get back from SET("PRINTER",2)? Or does it change if you do a SET PRINTER TO NAME xxxx ?

I could wip up my own dialog box, but I really need access to all the settings/pages/landscape etc that the Setup Printer dialog brings up.

Another alternative is I guess I could use the Common Dialog OCX and access the printer stuff that way. I'm not sure if even THAT does what I need it to do or not. Thanks anyways, Ken.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform