>Greetings,
>
>I have an application in VFP 6.0 that gets a list of all the printers from the registry. This uses the Registry.Vcx that ships with VFP 6.0. I then present all the printers in a list box for the user to select. After the user selects the desired printer, I then write the selection back to the registry and also write the selection to the device key in the win.ini file (About the 4th line down).
>
>When I do this, MS Mail encounters a problem. It says there is a printer problem. When I check the registry and the win.ini files, everything has been changed as the user selected. If I go into "Start", "Settings", "Printers" and select any printer and set it to default, then the MS Mail works OK.
>
>I was able to trace the MS Mail error back to the changing of the Win.ini file. If I don't do this, MS Mail works fine, but it wants to send the printout to the old default printer, not the printer changed via the application.
>
You might want to investigate the DEFPRINT.ZIP utility I mentioned a few days ago from
www.ntfaq.com; it is a utility that will correctly assign the default printer for Windows that works from the command line, and the C code for it would provide a correct template for performing the necessary manipulations for you.