Desktop Functions: Smart Device Functions:
|
The GetDefaultPrinter function retrieves the printer name of the default printer for the current user on the local computer C# Signature:
[DllImport("winspool.drv", CharSet = CharSet.Auto, SetLastError = true)] VB Signature:
Declare Function GetDefaultPrinter Lib "winspool.drv" Alias "GetDefaultPrinterA" _ User-Defined Types:None. Notes:Works even if print spooler service is stopped (W2K) You will need to import System.Runtime.InteropServices. Tips & Tricks:Sample Code:private const int ERROR_FILE_NOT_FOUND = 2; private const int ERROR_INSUFFICIENT_BUFFER = 122; public static String getDefaultPrinter() {
int pcchBuffer = 0; } Alternative Managed API:Do you know one? Please contribute it! Please edit this page!Do you have...
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).
|
|