Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get/Set Default Printer
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00095055
Message ID:
00095419
Views:
26
>>>>Is there any way of obtaining the windows default printer name and also setting the default printer without using GetProfileString() - I would prefer to avoid INI files. I have obtained the printer details via APRINTER() but just need to be able to set default, do my printing, then set back again. Any ideas?
>>>
>>>If I followed the thread correctly, you already know about getting the default. Setting the default (system wide, not just for VFP) must be done either by modifying the registry or the WIN.INI file. I personally would prefer the INI file, since registry corruption can quickly turn an expensive piece of hardware into a paper weight. However, there are files in the download section that will allow you to work with either method. BTW, my INI files class automatically broadcasts and changes to Win.ini, so that active applications are aware of the change.
>>
>>George,
>>
>>It has been my belief for some time that MS will eventually discard INI files. I have downloaded your class and am presently looking at it but something I noticed on my PC here at work when I looked at Win.INI and System.INI - the first line in each says (and I quote) ": for 16-bit app support". Could this be a hint???
>
>Undoubtedly. I agree that eventually Windows itself won't use INI files. However, the functions may hang around for awhile. Of course, this is a guess on my part. I fully appreciate and understand why the registry, in many cases, is preferable. However, I don't like fooling with it unless absolutely necessary. My own apps use an INI file to store dynamic values, window positions for example. Static values (or mostly static values) are stored in the registry.
>
>I should know more about the Win 98 API within the next week or so. If you like, I'll check out whether or not the INI file functions are still to be found.

That would be affirmative. I have been running Win98 for little while now and in this version ( CP Build 1650 ), it seems that the info stored in the ini files is stored in the registry as well (Somewhere <g>). You should be able to get the info from either place because the ini API calls are mapped to the registry.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform