function SetPrintDefault( cModel )
local cDriver := StrToken( GetProfString( "Devices", cModel, "" ), 1, "," )
local cPort := StrToken( GetProfString( "Devices", cModel, "" ), 2, "," )
WriteProfString( "Windows", "Device", cModel + ",", + cDriver + "," + cPort )
return nil
Marc Vanzegbroeck wrote:It's working, but the problem stays.
As I already experience before. If I start the application, then change the defaultprinter, he program still print to to default printer as it was wen starting the program.
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oPrn, oFnt
LOCAL nHStep, nVStep
SETPRINTDEFAULT( "Win2PDF" )
PRINT oPrn PREVIEW
DEFINE FONT oFnt NAME "Arial" SIZE 0, -10 OF oPrn
nHStep = oPrn:nHorzRes() / 80
nVStep = oPrn:nVertRes() / 66
PAGE
oPrn:Say( 0, 0, "This is a test", oFnt )
oPrn:Say( 1 * nVStep, 0, "This is a test", oFnt )
ENDPAGE
ENDPRINT
RELEASE FONT oFnt
RETURN NIL
function SetPrintDefault( cModel )
local cDriver := StrToken( GetProfString( "Devices", cModel, "" ), 1, "," )
local cPort := StrToken( GetProfString( "Devices", cModel, "" ), 2, "," )
WriteProfString( "Windows", "Device", cModel + ",", + cDriver + "," + cPort )
return nil
James Bott wrote:As I mentioned in my previous message I highly recommend against changing the Windows default printer from within an application. Users are not going to expect this and it will probably upset them. Personally, I would be upset if a program did this.
Return to FiveWin for CA-Clipper
Users browsing this forum: No registered users and 0 guests