Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Система";
Текущий архив: 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
3-74610
Gaber
2002-12-05 10:30
2002.12.23
Перенос данных из Excel в IB


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


1-74818
Teapot
2002-12-11 18:28
2002.12.23
Поломался интерфейс Delphi


8-74859
DNT
2002-09-06 17:19
2002.12.23
Синтезирование звука.


8-74845
Юрий К
2002-09-06 02:01
2002.12.23
Воспроизведение аудио файлов





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский