User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 391,584 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,676 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser:
Views: 515 | Replies: 4 | Solved
Reply
Join Date: Nov 2007
Posts: 63
Reputation: Sawamura is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 6
Sawamura's Avatar
Sawamura Sawamura is offline Offline
Junior Poster in Training

printer properties

  #1  
Apr 5th, 2008
hi all,
thanks to helping until this time.
now i want to display printer properties...
please help me to do this. do i have to using api function to do this??

any help will be appreciated...
best regards
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2007
Location: India
Posts: 493
Reputation: choudhuryshouvi is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 45
choudhuryshouvi's Avatar
choudhuryshouvi choudhuryshouvi is offline Offline
Posting Pro in Training

Re: printer properties

  #2  
Apr 5th, 2008
what have you meant by printer properties?

plz explain in detail.

or you can try this :-

add the component Microsoft Common Dialog Control 6.0 from Project->Components.
make an instance of it on your form.
now take a comman button and place this code,
Private Sub Command1_Click()
CommonDialog1.ShowPrinter
End Sub

It will show you the windows Print dialog box (the same one which you might be seen when trying to print documents from external windows applications like Notepad,wordpad,etc.

using API becomes more advance technique. you can API to access printer properties and configure it right through your code like finding its driver, setting up proper port, sending print commands,etc.,etc. For API reference Visit This Link.

regards
Shouvik
Last edited by choudhuryshouvi : Apr 5th, 2008 at 11:10 am.
Shouvik_The_Expert_Coder
Have a problem? Don't worry just give me a call and I'll fix it for you.
Reply With Quote  
Join Date: Nov 2007
Location: Jogja
Posts: 2,383
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Rep Power: 9
Solved Threads: 206
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Nearly a Posting Maven

Re: printer properties

  #3  
Apr 5th, 2008
try this following code :
  1. Private Declare Function OpenPrinter Lib "winspool.drv" Alias "OpenPrinterA" (ByVal pPrinterName As String, phPrinter As Long, pDefault As Any) As Long
  2. Private Declare Function ClosePrinter Lib "winspool.drv" (ByVal hPrinter As Long) As Long
  3. Private Declare Function PrinterProperties Lib "winspool.drv" (ByVal hwnd As Long, ByVal hPrinter As Long) As Long
  4. Private Sub Form_Load()
  5. Dim hPrinter As Long
  6. OpenPrinter Printer.DeviceName, hPrinter, ByVal 0&
  7. PrinterProperties Me.hwnd, hPrinter
  8. ClosePrinter hPrinter
  9. End Sub
hope this helps...
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote  
Join Date: Nov 2007
Posts: 63
Reputation: Sawamura is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 6
Sawamura's Avatar
Sawamura Sawamura is offline Offline
Junior Poster in Training

Re: printer properties

  #4  
Apr 5th, 2008
wow...thanks all.
thanks shouvik...
thanks too jx_man...
Reply With Quote  
Join Date: Nov 2007
Location: Jogja
Posts: 2,383
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Rep Power: 9
Solved Threads: 206
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Nearly a Posting Maven

Re: printer properties

  #5  
Apr 5th, 2008
yeah...you're welcome
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 10:58 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC