VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Show Printer Document Properties setup dialog

by Duncan Jones (19 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

Shows the printer document properties dialog box from code.

Side Effects
This entry in Shell32.dll is only present in version 4.71 and above (Windows NT 4 and Internet Explorer 4.0 or above)
API Declarations
'SHSTDAPI_(BOOL) SHInvokePrinterCommandA(HWND hwnd, UINT uAction, LPCSTR lpBuf1, LPCSTR lpBuf2, BOOL fModal);
Private Declare Function SHInvokePrinterCommand Lib "shell32.dll" Alias "SHInvokePrinterCommandA" (ByVal hWnd As Long, ByVal uAction As enPrinterActions, ByVal Buffer1 As String, ByVal Buffer2 As String, ByVal Modal As Long) As Long
Public Enum enPrinterActions
PRINTACTION_OPEN = 0
PRINTACTION_PROPERTIES = 1
PRINTACTION_NETINSTALL = 2
PRINTACTION_NETINSTALLLINK = 3
PRINTACTION_TESTPAGE = 4
PRINTACTION_OPENNETPRN = 5
PRINTACTION_DOCUMENTDEFAULTS = 6
PRINTACTION_SERVERPROPERTIES = 7
End Enum

Rate Show Printer Document Properties setup dialog

Public Sub DisplayDocumentDefaults(ByVal PrinterName As String, ByVal hWnd As Long)
Dim lRet As Long
'\\ Only version 4.71 and above have this :. jump over error
On Error Resume Next
lRet = SHInvokePrinterCommand(hWnd, PRINTACTION_DOCUMENTDEFAULTS, PrinterName, "", 0)

End Sub

Download this snippet    Add to My Saved Code

Show Printer Document Properties setup dialog Comments

No comments have been posted about Show Printer Document Properties setup dialog. Why not be the first to post a comment about Show Printer Document Properties setup dialog.

Post your comment

Subject:
Message:
0/1000 characters