Article View: borland.public.delphi.nativeapi
Article #68Re: Print Properties
From: Peter Below (TeamB)
Date: Wed, 21 Jan 2004 19:06
Date: Wed, 21 Jan 2004 19:06
38 lines
2345 bytes
2345 bytes
In article <400d85c5@newsgroups.borland.com>, Camiel Wijffels wrote:
> When you click the button in your configuration the app comes up with the
> correct (so none-default) printer, however when you select the properties
> page in this window, the default printer pops up again.
Weird.
> However I seem to have solved it, by using the following construct:
> with Printer do begin
> PrinterIndex := ListBox1.ItemIndex;
> SetPrinter(PChar(Printers[PrinterIndex]), nil, nil, 0);
> end;
>
> Is this the correct way to walk? Or am I maybe missing some point?
Instead of the second line better try this procedure:
procedure ResetPrinter; { Steve Schafer (TeamB emeritus) }
var
Device, Driver, Port: array[0..80] of Char;
DevMode: THandle;
begin
Printer.GetPrinter(Device, Driver, Port, DevMode);
Printer.SetPrinter(Device, Driver, Port, 0)
end;
> BTW, was this problem not known yet? Or is it just me?
I cannot remember posts about a similar problem, so it's either just you or
Alzheimer at work...
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
Technical Details
Message-ID:
<VA.0000a8ce.0070d06f@nomail.please>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<400b0645@newsgroups.borland.com> <400c4998$1@newsgroups.borland.com> <VA.0000a8c2.0062bc4e@nomail.please> <400d85c5@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f94dd,9c65616b0876a2f9 X-Google-Attributes: gidf94dd,public X-Google-ArrivalTime: 2004-01-21 11:10:56 PST Date: Wed, 21 Jan 2004 20:06:47 +0100 Newsgroups: borland.public.delphi.nativeapi Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Newsreader: Virtual Access by Atlantic Coast PLC, http://www.atlantic-coast.com/va Organization: TeamB Message-ID: <VA.0000a8ce.0070d06f@nomail.please> Subject: Re: Print Properties From: "Peter Below (TeamB)" <100113.1101@compuXXserve.com> Reply-To: 100113.1101@compuXXserve.com References: <400b0645@newsgroups.borland.com> <400c4998$1@newsgroups.borland.com> <VA.0000a8c2.0062bc4e@nomail.please> <400d85c5@newsgroups.borland.com> NNTP-Posting-Host: 62.226.187.178 X-Trace: newsgroups.borland.com 1074711901 62.226.187.178 (21 Jan 2004 11:05:01 -0700) Lines: 40 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail