Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.12.23;
Скачать: CL | DM;

Вниз

вопрос о принтерах   Найти похожие ветки 

 
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;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.018 c
3-74595
b_baranov
2002-12-04 02:34
2002.12.23
Как перехватить занесение в базу записи, содержащей Null-значения


14-74954
Дмитрий К.К.
2002-11-29 09:31
2002.12.23
Чтение новостных групп


3-74594
Tiny
2002-12-04 08:31
2002.12.23
DBGrid и картинки....


1-74844
Vit@ly
2002-12-08 17:14
2002.12.23
Проблема с Memo в XP и Win2000


14-74951
Wasiliy
2002-12-03 03:35
2002.12.23
Потрепаться