Page 1 of 3

How To Fetch Printer Properties from the Selected Printer

Posted: Thu May 21, 2009 1:20 pm
by swapan
Dear All,

In my print routine I want to use the following command:

lSuccess:=.t.
SELECT PRINTER DIALOG TO lSuccess PREVIEW

The command is working perfectly - opening the Printer Dialog box. Where I can change the default settings of the printer and go for printing.

Now I want to detect in my routine what properties the user selected. Like Paper Orientation (landscape/Potrait), PaperSize. How to accomplish this?

If I can get these values, I'm sure we can RE-SET this values also. Any internal global constants being used or what's the way to obtain this?

With regards,

Swapan

Re: How To Fetch Printer Properties from the Selected Printer

Posted: Thu May 21, 2009 5:36 pm
by salamandra
;) Hi swapan,
swapan wrote:Dear All,

In my print routine I want to use the following command:

lSuccess:=.t.
SELECT PRINTER DIALOG TO lSuccess PREVIEW

The command is working perfectly - opening the Printer Dialog box. Where I can change the default settings of the printer and go for printing.

Now I want to detect in my routine what properties the user selected. Like Paper Orientation (landscape/Potrait), PaperSize. How to accomplish this?

If I can get these values, I'm sure we can RE-SET this values also. Any internal global constants being used or what's the way to obtain this?

With regards,

Swapan
Do you really need to fetch ALL PRINTER PROPERTIES ???
HMG has a lot of features....
Why don't you write your own Printer Manager ???

Take a look at the attached sample, may be what you need...



Best regards.

[]'s Salamandra

Re: How To Fetch Printer Properties from the Selected Printer

Posted: Fri May 22, 2009 4:08 am
by sudip
Hi Salamandra,

Thanks a lot! Excellent! :-)

Regards.

Sudip

Re: How To Fetch Printer Properties from the Selected Printer

Posted: Fri May 22, 2009 4:18 am
by swapan
salamandra wrote:;) Hi swapan,

Do you really need to fetch ALL PRINTER PROPERTIES ???
HMG has a lot of features....
Why don't you write your own Printer Manager ???

Take a look at the attached sample, may be what you need...



Best regards.

[]'s Salamandra
That's simply great Salamandra! Thanks a lot for such a clean, concise and simple project to give an idea of how to build one's own Print Manager. This is going to help me and many others like me who intend to build a Print Manager to have a full command.

But I'm still looking for any solution like API call, low-level windows commands to fetch atleast the basic printer properties with the help of windows.

Regards,

Swapan

Re: How To Fetch Printer Properties from the Selected Printer

Posted: Fri May 22, 2009 11:54 am
by swapan
Can anything be derived with the help of _HMG_SYSDATA?

Re: How To Fetch Printer Properties from the Selected Printer

Posted: Fri May 22, 2009 1:07 pm
by salamandra
:) Hi Sudip & Swapan,

Thanks for your nice words.
This is a really very single sample based on my own print manager.
The basic idea behind it, it is : Give to users not all that they want,
but all that what they really need
.
As I use only a half dozen of paper sizes, and both Portrait and Landscape
orientation for reports, so it is easier to control and predefine user options.

Regarding Windows API and low-level windows functions, please take a look at
http://www.codeproject.com/KB/system/Pr ... indow.aspx

May be this article help you, because shows the method how to show a popup
window for printer properties.

Best Regards,


[]'s Salamandra

Re: How To Fetch Printer Properties from the Selected Printer

Posted: Fri May 22, 2009 1:34 pm
by sudip
Hi Salamandra,
salamandra wrote::) Hi Sudip & Swapan,
...
...
The basic idea behind it, it is : Give to users not all that they want,
but all that what they really need
.
Thank you very much.

I agree with you 100% :D

I went thru the url you specified. Very good :)

I like YOUR code and saved it in my computer :)

Regards.

Sudip

Re: How To Fetch Printer Properties from the Selected Printer

Posted: Fri May 22, 2009 2:16 pm
by Vanguarda
Hi my frieds,

Salamandra,
thank you for this code... it will very usefull for me. And, once again, thank you for have posted URL link for API WIN. Great Post




best Regards,

Re: How To Fetch Printer Properties from the Selected Printer

Posted: Fri May 22, 2009 2:29 pm
by salamandra
:) Hi,

Thanks to all for your nice words and I am feeling very honored that you want
to keep my single code :oops:
I am searching for some additional information, and may be in a few days I'll get
post here a complete (or almost complete) set of commands to retrieve, restore and
define printers properties. ;)

[]'s Salamandra

Re: How To Fetch Printer Properties from the Selected Printer

Posted: Fri May 22, 2009 9:11 pm
by Vanguarda
Hi salamandra,

It will be very nice. Great idea.

PS: Your code is "simple", but is very useful... I like it very much.


Regards,