Salat
Well-known member
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:
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
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
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