Форум: "Система";
Текущий архив: 2002.12.23;
Скачать: [xml.tar.bz2];
Внизвопрос о принтерах Найти похожие ветки
← →
angelcom (2002-10-20 08:03) [0]Как узнать установлен ли в системе принтер (сетевой или локальный)?
← →
Севостьянов Игорь (2002-10-21 12:48) [1]Список установленных принтеров в системе (информация берется из реестра [HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Devices] и [HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\PrinterPorts])
uses ..., Printer;
...
var
Printer: TPrinter;
begin
Printer := TPrinter.Create;
try
Memo1.Clear;
Memo1.Lines.AddStrings(Printer.Printers);
finally
Printer.Free;
end;
end;
Если в имени присутвует сетевой путь - это сетевой принтер
Имеется еще EnumPrinters
The EnumPrinters function enumerates available printers, print servers, domains, or print providers.
BOOL EnumPrinters(
DWORD Flags, // printer object types
LPTSTR Name, // name of printer object
DWORD Level, // information level
LPBYTE pPrinterEnum, // printer information buffer
DWORD cbBuf, // size of printer information buffer
LPDWORD pcbNeeded, // bytes received or required
LPDWORD pcReturned // number of printers enumerated
);
У нее есть DWORD Flags, // printer object types
Flags
[in] Specifies the types of print objects that the function should enumerate. This value can be one or more of the following values. Value Meaning
PRINTER_ENUM_LOCAL The function ignores the Name parameter, and enumerates the locally installed printers.
Windows 95: The function will also enumerate network printers because they are handled by the local print provider.
PRINTER_ENUM_NAME The function enumerates the printer identified by Name. This can be a server, a domain, or a print provider. If Name is NULL, the function enumerates available print providers.
PRINTER_ENUM_SHARED The function enumerates printers that have the shared attribute. Cannot be used in isolation; use an OR operation to combine with another PRINTER_ENUM type.
PRINTER_ENUM_DEFAULT Windows 95: The function returns information about the default printer.
PRINTER_ENUM_CONNECTIONS Windows NT/ 2000: The function enumerates the list of printers to which the user has made previous connections.
PRINTER_ENUM_NETWORK Windows NT/ 2000: The function enumerates network printers in the computer"s domain. This value is valid only if Level is 1.
PRINTER_ENUM_REMOTE Windows NT/ 2000: The function enumerates network printers and print servers in the computer"s domain. This value is valid only if Level is 1.
Бери и вычисляй, те которые тебе нужны
← →
Севостьянов Игорь (2002-10-21 12:51) [2]Да для Win9x ключи конечно другие Windows NT -> Windows
Страницы: 1 вся ветка
Форум: "Система";
Текущий архив: 2002.12.23;
Скачать: [xml.tar.bz2];
Память: 0.45 MB
Время: 0.009 c