lastbta.blogg.se

Windows api enumprintersw
Windows api enumprintersw












If pKeyName does not exist, the return value is ERROR_FILE_NOT_FOUND. If the function fails, the return value is a system error code. If the function succeeds, the return value is ERROR_SUCCESS. If the buffer size specified by cbSubkey is too small, the function returns ERROR_MORE_DATA and pcbSubkey indicates the required buffer size. If you set cbSubkey to zero, the pcbSubkey parameter returns the required buffer size.Ī pointer to a variable that receives the number of bytes retrieved in the pSubkey buffer. The size, in bytes, of the buffer pointed to by pSubkey. The array is terminated by two null characters.

Windows api enumprintersw

If pKeyName is NULL, EnumPrinterKey returns ERROR_INVALID_PARAMETER.Ī pointer to a buffer that receives an array of null-terminated subkey names.

Windows api enumprintersw

If pKeyName is an empty string (""), EnumPrinterKey enumerates the top-level key for the printer. EnumPrinterKey enumerates all subkeys of the key, but does not enumerate the subkeys of those subkeys. Use the backslash '\' character as a delimiter to specify a path with one or more subkeys. Use the OpenPrinter or AddPrinter function to retrieve a printer handle.Ī pointer to a null-terminated string that specifies the key containing the subkeys to enumerate. Syntax DWORD EnumPrinterKey(Ī handle to the printer for which the function enumerates subkeys.

Windows api enumprintersw

While enumerating printer data, do not call registry functions that might change the data. The EnumPrinterDrivers function enumerates the printer drivers installed on a specified printer server.

This way you can use GetTextMetrics to easily determine the available horizontal space, just as you would on any other window.The EnumPrinterKey function enumerates the subkeys of a specified key for a specified printer. Win32 API windows apibcbobo21cn-CSDN Win32 API bcbobo21cn 23:06:12 750 1 VC++ EnumPrinters PRINTERINFO5 VC++ 492 15 EnumPrinters include include If you need info beyond the name, description and comment, try the PRINTER_INFO_2 structure instead.Īs far as I know, when using the Win32 API directly, you'll need to wrap your text manually, meaning that you'll have to keep track of where you are horizontally on the page, based on the width of the characters and the width of the page.ĭoing this will probably be easier if you use a device context when printing, instead of sending raw data to the printer, as I think you're doing. A short program is below that shows how to use it. You can get information about each installed printer by calling EnumPrinters.














Windows api enumprintersw