Discussion:
XPRINT ATTACH CHOOSE
(too old to reply)
Wolfgang Enzinger
2007-04-11 11:46:44 UTC
Permalink
Hi,

I'm having two problems with the statement "XPRINT ATTACH CHOOSE":

1. Each time the printer dialog pops up, the default printer is
preselected. Is there a way to preselect a different one? I tried
calling "XPRINT ATTACH PrinterName" before calling X. A. CHOOSE, but
to no effect.

2. I'm using X. A. CHOOSE in a DLL called from a VB program in order
to avoid the buggy VB Printer object; works like a charm, very stable.
However, I noticed that the printer dialog generated by X. A. CHOOSE
isn't modal to the calling form, i.e. if I click on my main form the
printer dialog disappears in the background. Is there a way to make
the printer dialog truely modal?

Any input is much appreciated.
--
Viele Grüsse,
Wolfgang
http://www.enzinger.net
Michael Mattias
2007-04-11 12:58:42 UTC
Permalink
Post by Wolfgang Enzinger
1. Each time the printer dialog pops up, the default printer is
preselected. Is there a way to preselect a different one?
...
Post by Wolfgang Enzinger
2. ....the printer dialog generated by X. A. CHOOSE
isn't modal to the calling form,
The simple answer is, if you are using the XPRINT statement, you are limited
to the options offered by that statement.

For XPRINT ATTACH CHOOSE with a named printer as the default, I posted code
to do this at
http://www.powerbasic.com/support/forums/Forum7/HTML/002446.html

Or, you could temporarily set the system default printer to the desired
printer, use XPRINT ATTACH CHOOSE, then set the default back. You can use
SetDefaultPrinter (Windows 2000+ ) to do so; see your WinAPI reference for
details.

As far as making the dialog 'truly' modal, I "believe" the common dialog
on which I based th above code is such. If not, you could simulate
'modality' by disabling your program's main window before calling either
XPRINT ATTACH CHOOSE or the code referenced above.
--
Michael C. Mattias
Tal Systems Inc.
Racine WI
Post by Wolfgang Enzinger
--
Viele Grüsse,
Wolfgang
http://www.enzinger.net
Wolfgang Enzinger
2007-04-11 14:43:11 UTC
Permalink
Hi Michael,
Post by Michael Mattias
For XPRINT ATTACH CHOOSE with a named printer as the default, I posted code
to do this at
http://www.powerbasic.com/support/forums/Forum7/HTML/002446.html
thanks a lot, I'll have a look at this. I *knew* someone must have had
that prob before, but all my googlin' didn't take me there ...
Post by Michael Mattias
Or, you could temporarily set the system default printer to the desired
printer, use XPRINT ATTACH CHOOSE, then set the default back. You can use
SetDefaultPrinter (Windows 2000+ ) to do so; see your WinAPI reference for
details.
However, I'm pretty sure that changing the default printer requires
certain permissions on the system; some of my users obviously lack
these permissions, so I hopefully won't need that workaround.
Post by Michael Mattias
As far as making the dialog 'truly' modal, I "believe" the common dialog
on which I based th above code is such. If not, you could simulate
'modality' by disabling your program's main window before calling either
XPRINT ATTACH CHOOSE or the code referenced above.
Yeah, that would be an option if everything else should fail.

Thanks again,
Wolfgang

Loading...