printer's properties dialog

Salat

Well-known member
Joined
Mar 5, 2002
Messages
81
Location
Poland, Silesia
I was wondering how to show default printers propertis dialog (You know, this one, which is shown when button is clicked next to the combo with all list of installed printers, on a default Print dialog)

Im tring to write Print dialog, same as the PrintDialog control but with some other options. So I need this button to work properly...

Ive tried this code:
Code:
    Private Declare Function OpenPrinter Lib "winspool.drv" Alias "OpenPrinterA" (ByVal pPrinterName As String, ByVal phPrinter As Long, ByVal pDefault As Integer) As Long
    Private Declare Function ClosePrinter Lib "winspool.drv" (ByVal hPrinter As Long) As Long
    Private Declare Function PrinterProperties Lib "winspool.drv" (ByVal hwnd As Long, ByVal hPrinter As Long) As Long

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim hPrinter As Long
        OpenPrinter(ComboBox1.SelectedItem, hPrinter, 0&)
        PrinterProperties(1, hPrinter)
        ClosePrinter(hPrinter)
    End Sub
but the hPrinter is 0, after OpenPrinter is called

Have You got any ideas....?

I was also wondering how to get printers info (state, comments, etc.), I have tryed the code from API-Guide, but it also didnt work.

thank You for your advices....

Piotrek
 

Similar threads

J
Replies
0
Views
133
Joseph261
J
G
Replies
0
Views
243
Gowrisankarrs
G
I
Replies
0
Views
156
Innovators World Wide
I
Back
Top