How To Fetch Printer Properties from the Selected Printer

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: How To Fetch Printer Properties from the Selected Printer

Post by swapan »

salamandra wrote::) 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
Dear Salamandra,

You provided me and many others like me the simple way to get the Printer Dialog programmatically under our control. So you do deserve thanks from our bottom of heart for sharing your piece of R&D on printing with us. Not yet gone through the link you've provided.

I'm looking forward to your "search" for additional information regarding this. I too have googled a bit and seen some codes written in VB to retrieve and set printer properties through API calls. But I couldn't decipher much with my limited knowledge. When we select the Page Orientation and PaperSize from the Windows Printer Dialog, windows does stores it somewhere, we have to fetch those values from any API call or low-level command .........

Regards,

Swapan
[PS:BTW Salamandra, r u from Brazil? U know there are many supporters of Brazil (football team) in my city Calcutta :D ]
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
Rathinagiri
Posts: 5480
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: How To Fetch Printer Properties from the Selected Printer

Post by Rathinagiri »

I think the default printer settings would be stored in registry settings and that can be retrieved from HMG functions RegistryRead() and RegistryWrite()

It is in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: How To Fetch Printer Properties from the Selected Printer

Post by swapan »

rathinagiri wrote:I think the default printer settings would be stored in registry settings and that can be retrieved from HMG functions RegistryRead() and RegistryWrite()

It is in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers
Thanks Rathi for putting your thoughts.....

But this will hold all the printers names, now which one is default/selected printer among them? And I think this registry location may vary from windows version to version.
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
salamandra
Posts: 311
Joined: Thu Jul 31, 2008 8:33 pm
DBs Used: DBF, MySQL, SQL
Location: Brazil

Re: How To Fetch Printer Properties from the Selected Printer

Post by salamandra »

Hi swapan,
Dear Salamandra,
You provided me and many others like me the simple way to get the Printer Dialog programmatically under our control. So you do deserve thanks from our bottom of heart for sharing your piece of R&D on printing with us. Not yet gone through the link you've provided.
I'm looking forward to your "search" for additional information regarding this. I too have googled a bit and seen some codes written in VB to retrieve and set printer properties through API calls. But I couldn't decipher much with my limited knowledge. When we select the Page Orientation and PaperSize from the Windows Printer Dialog, windows does stores it somewhere, we have to fetch those values from any API call or low-level command .........

Regards,

Swapan
[PS:BTW Salamandra, r u from Brazil? U know there are many supporters of Brazil (football team) in my city Calcutta :D ]
Thanks four your words. :oops:
I am developing a new print manager with some additional resources
(eg search network printers , install/Uninstall printers, define as default printer and
other resources).
I have very little time to spend in it, but it is almost 50% ready.
May be I'll get finished in two or three weeks, and my basic idea is once finished,
post it here in our forum (as FREE CODE), because I think that this print manager
could be a big help for many of our HMGF friends.
Regarding on how to retrieve printer's names, i think you can do as rathi suggested
and you can get the default printer using HMG function GetDefaultPrinter().

And.... YES, I am from Brazil (the land of soccer ;) ), but I was born in Argentina
(another land of soccer :lol: ) and came to Brazil almost 30 years ago ( a looooooooooooong time) :D .

Best Regards,


Salamandra
There is one time in which is crucial awakening. That time is now. ( Buddha )
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: How To Fetch Printer Properties from the Selected Printer

Post by swapan »

salamandra wrote: I am developing a new print manager with some additional resources
(eg search network printers , install/Uninstall printers, define as default printer and
other resources).
I have very little time to spend in it, but it is almost 50% ready.
May be I'll get finished in two or three weeks, and my basic idea is once finished,
post it here in our forum (as FREE CODE), because I think that this print manager
could be a big help for many of our HMGF friends.
Eagerly waiting for your Open Source Product!
salamandra wrote: And.... YES, I am from Brazil (the land of soccer ;) ), but I was born in Argentina
(another land of soccer :lol: ) and came to Brazil almost 30 years ago ( a looooooooooooong time) :D .
No worries! 2nd biggest fans from Calcutta (Kolkata) are from Argentina! :D
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
Vanguarda
Posts: 543
Joined: Wed Feb 11, 2009 10:56 am
Location: Americana - SP
Contact:

Re: How To Fetch Printer Properties from the Selected Printer

Post by Vanguarda »

Hi friends,

Salamandra, i waiting for this open source function. I think that this will be very help for all us. It is amazing...

thanks a lot


regards,
--
Paulo Sérgio Durço (Vanguarda)


http://hmglights.wordpress.com/
User avatar
Rathinagiri
Posts: 5480
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: How To Fetch Printer Properties from the Selected Printer

Post by Rathinagiri »

Me too. When would that be ready? Can you post some screenshots?!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: How To Fetch Printer Properties from the Selected Printer

Post by swapan »

rathinagiri wrote:Me too. When would that be ready? Can you post some screenshots?!
Salamandra: Are we putting undue pressure on you?! :D Please take your time, but do share your this wonderful Print Manager with us.

-- Swapan
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
salamandra
Posts: 311
Joined: Thu Jul 31, 2008 8:33 pm
DBs Used: DBF, MySQL, SQL
Location: Brazil

Re: How To Fetch Printer Properties from the Selected Printer

Post by salamandra »

Hi to all,
swapan wrote:
rathinagiri wrote:Me too. When would that be ready? Can you post some screenshots?!
Salamandra: Are we putting undue pressure on you?! :D Please take your time, but do share your this wonderful Print Manager with us.

-- Swapan
Under pressure, no.... well... only a little bit :lol:
My new print manager it's 90% finished.
I am reviewing all the code trying to make it more readable, simple and light as much as possible.
(and I'm reviewing layout issues also)
By now, are about 700 lines of code, including main form and network search printers form.
I'd tested as much as i can, and it's working fine.
And for those who suffer from chronic anxiety ( :lol: :lol: :lol: :lol: :lol: ),
this is a screenshot
image_prt_mgr.JPG
image_prt_mgr.JPG (65.83 KiB) Viewed 4718 times

As I said, I'm still working in it, and as you can see the PROPERTIES button,
in background form is missing. ( he'll be back soon ;) )
I think, i have more one or two weeks until I've finished.
(I already have almost no time to spend with it)

As you can see, used language is PORTUGUESE, but I'd changed this to work
in accordance with HMG language selection, and sorry boys, only 3 language will be
availables for selection: PORTUGUESE, SPANISH and ENGLISH.
This means:
SET LANGUAGE TO PORTUGUESE => Portuguese translation
SET LANGUAGE TO SPANISH => Spanish translation
SET LANGUAGE TO ENGLISH => English Translation
SET LANGUAGE TO <OTHER_LANG.> => English Translation

Ok ?? ;)

On the other hand, will be easy to change any of the defaults languages to any other.
Based on the ENGLISH translation and GOOGLE translator ( :lol: :lol: :lol: :lol: :lol: :lol: )
you can easyly translate to your own language.

Well,it's all for now..... and be patient...

Best Regards,


Salamandra
Attachments
image_prt_mgr.JPG
image_prt_mgr.JPG (68.82 KiB) Viewed 4715 times
There is one time in which is crucial awakening. That time is now. ( Buddha )
User avatar
Rathinagiri
Posts: 5480
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: How To Fetch Printer Properties from the Selected Printer

Post by Rathinagiri »

Marvelous! Gr8.

Eagerly waiting for the final product. Thanks Salamandra for sharing.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Post Reply