Форум: "Основная";
Текущий архив: 2005.03.27;
Скачать: [xml.tar.bz2];
ВнизОтслеживание печати на принтер Найти похожие ветки
← →
Separator © (2005-03-11 14:25) [0]Как отследить, что, кто и когда печатал на принтере? Нужна такая инфа: Название файла отправленного на печать, количество страниц.
← →
DiamondShark © (2005-03-11 14:33) [1]
> Название файла отправленного на печать
Я вот такой код выполню:
Printer.BeginDoc;
Printer.Canvas.TextOut(0, 0, "Hello, world!");
Printer.EndDoc;
Какое тут должно быть название файла?
← →
Separator © (2005-03-11 14:39) [2]Ну это ты такой умный, а у нас все печатают из вордов и экселей
← →
DiamondShark © (2005-03-11 14:47) [3]А чем печать из вордов и экселей отличается от приведённого кода?
← →
simpson © (2005-03-11 14:47) [4]> а у нас все печатают из вордов и экселей
И что? Спулер об имени файла ничего не знает, максимум, об имени документа, а это не одно и то же.
Как вариант:
unit Main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, XPMan, MonThrd, StdCtrls, AppEvnts;
type
TFormMain = class(TForm)
XPManifest1: TXPManifest;
Label1: TLabel;
PrinterLog: TMemo;
btnStart: TButton;
btnStop: TButton;
btnExit: TButton;
ApplicationEvents1: TApplicationEvents;
procedure FormCreate(Sender: TObject);
procedure btnExitClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure btnStartClick(Sender: TObject);
procedure btnStopClick(Sender: TObject);
procedure ApplicationEvents1Exception(Sender: TObject; E: Exception);
private
FMonThread: TMonThread;
public
end;
var
FormMain: TFormMain;
implementation
{$R *.dfm}
procedure TFormMain.FormCreate(Sender: TObject);
begin
Caption := Application.Title;
PrinterLog.Clear;
FMonThread := nil;
end;
procedure TFormMain.btnExitClick(Sender: TObject);
begin
Close();
end;
procedure TFormMain.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if FMonThread <> nil then
begin
PrinterLog.Lines.Insert(0, "Остановка монитора");
FMonThread.Terminate;
FMonThread.WaitFor;
end;
end;
procedure TFormMain.btnStartClick(Sender: TObject);
begin
PrinterLog.Lines.Insert(0, "Запуск монитора");
FMonThread := TMonThread.Create(False);
btnStop.Enabled := True;
btnStart.Enabled := False;
end;
procedure TFormMain.btnStopClick(Sender: TObject);
begin
if FMonThread <> nil then
begin
PrinterLog.Lines.Insert(0, "Остановка монитора");
FMonThread.Terminate;
FMonThread.WaitFor;
FreeAndNil(FMonThread);
btnStart.Enabled := True;
btnStop.Enabled := False;
end;
end;
procedure TFormMain.ApplicationEvents1Exception(Sender: TObject;
E: Exception);
begin
PrinterLog.Lines.Insert(0, Format("Исключение: %s", [E.Message]));
end;
end.
← →
simpson © (2005-03-11 14:51) [5]
unit MonThrd;
interface
uses
Classes, WinSpool;
type
PPRINTER_NOTIFY_INFO = ^PRINTER_NOTIFY_INFO;
TMonThread = class(TThread)
private
FError: String;
protected
procedure Execute; override;
procedure WriteError;
procedure WriteInfo;
procedure Set_Info(Value: String);
property Info: String write Set_Info;
end;
implementation
uses
Windows, Main, SysUtils, Printers;
{ TMonThread }
procedure TMonThread.Execute;
var
hPrinter: THandle;
hNotify: THandle;
no: PRINTER_NOTIFY_OPTIONS;
notype: array [1..2] of PRINTER_NOTIFY_OPTIONS_TYPE;
pnf, jnf: array [1..100] of WORD;
ChangeReason, I: DWORD;
p: PPRINTER_NOTIFY_INFO;
pBuf: PChar;
adwData: PDWORD;
begin
no.Version := 2;
no.Count := 2;
no.pTypes := @notype;
pnf[1] := PRINTER_NOTIFY_FIELD_SERVER_NAME;
pnf[2] := PRINTER_NOTIFY_FIELD_PRINTER_NAME;
pnf[3] := PRINTER_NOTIFY_FIELD_SHARE_NAME;
pnf[4] := PRINTER_NOTIFY_FIELD_PORT_NAME;
pnf[5] := PRINTER_NOTIFY_FIELD_DRIVER_NAME;
pnf[6] := PRINTER_NOTIFY_FIELD_COMMENT;
pnf[7] := PRINTER_NOTIFY_FIELD_LOCATION;
pnf[8] := PRINTER_NOTIFY_FIELD_SEPFILE;
pnf[9] := PRINTER_NOTIFY_FIELD_PRINT_PROCESSOR;
pnf[10] := PRINTER_NOTIFY_FIELD_PARAMETERS;
pnf[11] := PRINTER_NOTIFY_FIELD_DATATYPE;
pnf[12] := PRINTER_NOTIFY_FIELD_ATTRIBUTES;
pnf[13] := PRINTER_NOTIFY_FIELD_PRIORITY;
pnf[14] := PRINTER_NOTIFY_FIELD_DEFAULT_PRIORITY;
pnf[15] := PRINTER_NOTIFY_FIELD_START_TIME;
pnf[16] := PRINTER_NOTIFY_FIELD_UNTIL_TIME;
pnf[17] := PRINTER_NOTIFY_FIELD_STATUS_STRING;
pnf[18] := PRINTER_NOTIFY_FIELD_CJOBS;
pnf[19] := PRINTER_NOTIFY_FIELD_AVERAGE_PPM;
pnf[20] := PRINTER_NOTIFY_FIELD_TOTAL_PAGES;
pnf[21] := PRINTER_NOTIFY_FIELD_PAGES_PRINTED;
pnf[22] := PRINTER_NOTIFY_FIELD_TOTAL_BYTES;
pnf[23] := PRINTER_NOTIFY_FIELD_BYTES_PRINTED;
notype[1].wType := PRINTER_NOTIFY_TYPE;
notype[1].Count := 23;
notype[1].pFields := @pnf;
jnf[1] := JOB_NOTIFY_FIELD_PRINTER_NAME;
jnf[2] := JOB_NOTIFY_FIELD_MACHINE_NAME;
jnf[3] := JOB_NOTIFY_FIELD_PORT_NAME;
jnf[4] := JOB_NOTIFY_FIELD_USER_NAME;
jnf[5] := JOB_NOTIFY_FIELD_NOTIFY_NAME;
jnf[6] := JOB_NOTIFY_FIELD_DATATYPE;
jnf[7] := JOB_NOTIFY_FIELD_PRINT_PROCESSOR;
jnf[8] := JOB_NOTIFY_FIELD_PARAMETERS;
jnf[9] := JOB_NOTIFY_FIELD_DRIVER_NAME;
jnf[10] := JOB_NOTIFY_FIELD_STATUS_STRING;
jnf[11] := JOB_NOTIFY_FIELD_DOCUMENT;
jnf[12] := JOB_NOTIFY_FIELD_PRIORITY;
jnf[13] := JOB_NOTIFY_FIELD_POSITION;
jnf[14] := JOB_NOTIFY_FIELD_START_TIME;
jnf[15] := JOB_NOTIFY_FIELD_UNTIL_TIME;
jnf[16] := JOB_NOTIFY_FIELD_TIME;
jnf[17] := JOB_NOTIFY_FIELD_TOTAL_PAGES;
jnf[18] := JOB_NOTIFY_FIELD_PAGES_PRINTED;
jnf[19] := JOB_NOTIFY_FIELD_TOTAL_BYTES;
jnf[20] := JOB_NOTIFY_FIELD_BYTES_PRINTED;
notype[2].wType := JOB_NOTIFY_TYPE;
notype[2].Count := 20;
notype[2].pFields := @jnf;
if not OpenPrinter(nil, hPrinter, nil) then
begin
FError := "Не удалось получить описатель принтера.";
Synchronize(WriteError);
Exit;
end;
← →
simpson © (2005-03-11 14:52) [6]
try
hNotify := FindFirstPrinterChangeNotification(hPrinter, PRINTER_CHANGE_ALL,
0, @no);
if hNotify = INVALID_HANDLE_VALUE then
begin
FError := "Не удалось создать объект-уведомление.";
Synchronize(WriteError);
Exit;
end;
try
while not Terminated do
begin
case WaitForSingleObject(hNotify, 1000) of
WAIT_FAILED, WAIT_ABANDONED:
begin
FError := "Ожидание уведомления завершилось с ошибкой.";
Synchronize(WriteError);
Exit;
end;
WAIT_TIMEOUT:
Continue;
WAIT_OBJECT_0:
begin
no.Flags := 0;
if not FindNextPrinterChangeNotification(hNotify, ChangeReason,
@no, Pointer(p)) then
begin
FError := "Анализ уведомления завершился с ошибкой.";
Synchronize(WriteError);
Continue;
end;
FError := "";
if (ChangeReason and PRINTER_CHANGE_ADD_PRINTER) =
PRINTER_CHANGE_ADD_PRINTER then
FError := FError + "PRINTER_CHANGE_ADD_PRINTER | ";
if (ChangeReason and PRINTER_CHANGE_SET_PRINTER) =
PRINTER_CHANGE_SET_PRINTER then
FError := FError + "PRINTER_CHANGE_SET_PRINTER | ";
if (ChangeReason and PRINTER_CHANGE_DELETE_PRINTER) =
PRINTER_CHANGE_DELETE_PRINTER then
FError := FError + "PRINTER_CHANGE_DELETE_PRINTER | ";
if (ChangeReason and PRINTER_CHANGE_FAILED_CONNECTION_PRINTER) =
PRINTER_CHANGE_FAILED_CONNECTION_PRINTER then
FError := FError + "PRINTER_CHANGE_FAILED_CONNECTION_PRINTER | ";
if (ChangeReason and PRINTER_CHANGE_ADD_JOB) =
PRINTER_CHANGE_ADD_JOB then
FError := FError + "PRINTER_CHANGE_ADD_JOB | ";
if (ChangeReason and PRINTER_CHANGE_SET_JOB) =
PRINTER_CHANGE_SET_JOB then
FError := FError + "PRINTER_CHANGE_SET_JOB | ";
if (ChangeReason and PRINTER_CHANGE_DELETE_JOB) =
PRINTER_CHANGE_DELETE_JOB then
FError := FError + "PRINTER_CHANGE_DELETE_JOB | ";
if (ChangeReason and PRINTER_CHANGE_WRITE_JOB) =
PRINTER_CHANGE_WRITE_JOB then
FError := FError + "PRINTER_CHANGE_WRITE_JOB | ";
if (ChangeReason and PRINTER_CHANGE_ADD_FORM) =
PRINTER_CHANGE_ADD_FORM then
FError := FError + "PRINTER_CHANGE_ADD_FORM | ";
if (ChangeReason and PRINTER_CHANGE_SET_FORM) =
PRINTER_CHANGE_SET_FORM then
FError := FError + "PRINTER_CHANGE_SET_FORM | ";
if (ChangeReason and PRINTER_CHANGE_DELETE_FORM) =
PRINTER_CHANGE_DELETE_FORM then
FError := FError + "PRINTER_CHANGE_DELETE_FORM | ";
if (ChangeReason and PRINTER_CHANGE_ADD_PORT) =
PRINTER_CHANGE_ADD_PORT then
FError := FError + "PRINTER_CHANGE_ADD_PORT | ";
if (ChangeReason and PRINTER_CHANGE_CONFIGURE_PORT) =
PRINTER_CHANGE_CONFIGURE_PORT then
FError := FError + "PRINTER_CHANGE_CONFIGURE_PORT | ";
if (ChangeReason and PRINTER_CHANGE_DELETE_PORT) =
PRINTER_CHANGE_CONFIGURE_PORT then
FError := FError + "PRINTER_CHANGE_DELETE_PORT | ";
if (ChangeReason and PRINTER_CHANGE_ADD_PRINT_PROCESSOR) =
PRINTER_CHANGE_ADD_PRINT_PROCESSOR then
FError := FError + "PRINTER_CHANGE_ADD_PRINT_PROCESSOR | ";
if (ChangeReason and PRINTER_CHANGE_DELETE_PRINT_PROCESSOR) =
PRINTER_CHANGE_DELETE_PRINT_PROCESSOR then
FError := FError + "PRINTER_CHANGE_DELETE_PRINT_PROCESSOR | ";
if (ChangeReason and PRINTER_CHANGE_ADD_PRINTER_DRIVER) =
PRINTER_CHANGE_ADD_PRINTER_DRIVER then
FError := FError + "PRINTER_CHANGE_ADD_PRINTER_DRIVER | ";
if (ChangeReason and PRINTER_CHANGE_SET_PRINTER_DRIVER) =
PRINTER_CHANGE_SET_PRINTER_DRIVER then
FError := FError + "PRINTER_CHANGE_SET_PRINTER_DRIVER | ";
if (ChangeReason and PRINTER_CHANGE_DELETE_PRINTER_DRIVER) =
PRINTER_CHANGE_DELETE_PRINTER_DRIVER then
FError := FError + "PRINTER_CHANGE_DELETE_PRINTER_DRIVER | ";
if (ChangeReason and PRINTER_CHANGE_TIMEOUT) =
PRINTER_CHANGE_TIMEOUT then
FError := FError + "PRINTER_CHANGE_TIMEOUT | ";
Synchronize(WriteInfo);
← →
Separator © (2005-03-11 14:53) [7]MonThrd- это что?
← →
simpson © (2005-03-11 14:55) [8]
if p <> nil then
begin
for I := 0 to p^.Count - 1 do
begin
pBuf := p^.aData[I].NotifyData.Data.pBuf;
adwData := @(p^.aData[I].NotifyData.adwData);
case p^.aData[I].wType of
PRINTER_NOTIFY_TYPE:
begin
FError := "Тип: PRINTER_NOTIFY_TYPE";
Synchronize(WriteInfo);
case p^.aData[I].Field of
PRINTER_NOTIFY_FIELD_SERVER_NAME:
Info := "Сервер: " + StrPas(pBuf);
PRINTER_NOTIFY_FIELD_PRINTER_NAME:
Info := "Принтер: " + StrPas(pBuf);
PRINTER_NOTIFY_FIELD_SHARE_NAME:
Info := "Сетевой ресурс: " + StrPas(pBuf);
PRINTER_NOTIFY_FIELD_PORT_NAME:
Info := "Порт: " + StrPas(pBuf);
PRINTER_NOTIFY_FIELD_DRIVER_NAME:
Info := "Драйвер: " + StrPas(pBuf);
PRINTER_NOTIFY_FIELD_COMMENT:
Info := "Комментарий: " + StrPas(pBuf);
PRINTER_NOTIFY_FIELD_LOCATION:
Info := "Расположение: " + StrPas(pBuf);
PRINTER_NOTIFY_FIELD_DEVMODE:
Info := "PRINTER_NOTIFY_FIELD_DEVMODE";
PRINTER_NOTIFY_FIELD_SEPFILE:
Info := "Страница-разделитель: " + StrPas(pBuf);
PRINTER_NOTIFY_FIELD_PRINT_PROCESSOR:
Info := "Имя принт-процессора: " + StrPas(pBuf);
PRINTER_NOTIFY_FIELD_PARAMETERS:
Info := "Параметры принт-процессора: " + StrPas(pBuf);
PRINTER_NOTIFY_FIELD_DATATYPE:
Info := "Тип данных: " + StrPas(pBuf);
PRINTER_NOTIFY_FIELD_SECURITY_DESCRIPTOR:
Info := "PRINTER_NOTIFY_FIELD_SECURITY_DESCRIPTOR";
PRINTER_NOTIFY_FIELD_ATTRIBUTES:
begin
Info := "PRINTER_NOTIFY_FIELD_ATTRIBUTES";
if (PRINTER_ATTRIBUTE_QUEUED and adwData^) =
PRINTER_ATTRIBUTE_QUEUED then
Info := "PRINTER_ATTRIBUTE_QUEUED";
if (PRINTER_ATTRIBUTE_DIRECT and adwData^) =
PRINTER_ATTRIBUTE_DIRECT then
Info := "PRINTER_ATTRIBUTE_DIRECT";
if (PRINTER_ATTRIBUTE_DEFAULT and adwData^) =
PRINTER_ATTRIBUTE_DEFAULT then
Info := "PRINTER_ATTRIBUTE_DEFAULT";
if (PRINTER_ATTRIBUTE_SHARED and adwData^) =
PRINTER_ATTRIBUTE_SHARED then
Info := "PRINTER_ATTRIBUTE_SHARED";
end;
PRINTER_NOTIFY_FIELD_PRIORITY:
Info := "PRINTER_NOTIFY_FIELD_PRIORITY:";
PRINTER_NOTIFY_FIELD_DEFAULT_PRIORITY:
Info := "PRINTER_NOTIFY_FIELD_DEFAULT_PRIORITY:";
PRINTER_NOTIFY_FIELD_START_TIME:
Info := "PRINTER_NOTIFY_FIELD_START_TIME:";
PRINTER_NOTIFY_FIELD_UNTIL_TIME:
Info := "PRINTER_NOTIFY_FIELD_UNTIL_TIME:";
← →
simpson © (2005-03-11 14:55) [9]
PRINTER_NOTIFY_FIELD_STATUS:
begin
if (adwData^ and PRINTER_STATUS_PAUSED) =
PRINTER_STATUS_PAUSED then
Info := "PRINTER_STATUS_PAUSED";
if (adwData^ and PRINTER_STATUS_ERROR) =
PRINTER_STATUS_ERROR then
Info := "PRINTER_STATUS_ERROR";
if (adwData^ and PRINTER_STATUS_PENDING_DELETION) =
PRINTER_STATUS_PENDING_DELETION then
Info := "PRINTER_STATUS_PENDING_DELETION";
if (adwData^ and PRINTER_STATUS_PAPER_JAM) =
PRINTER_STATUS_PAPER_JAM then
Info := "PRINTER_STATUS_PAPER_JAM";
if (adwData^ and PRINTER_STATUS_PAPER_OUT) =
PRINTER_STATUS_PAPER_OUT then
Info := "PRINTER_STATUS_PAPER_OUT";
if (adwData^ and PRINTER_STATUS_MANUAL_FEED) =
PRINTER_STATUS_MANUAL_FEED then
Info := "PRINTER_STATUS_MANUAL_FEED";
if (adwData^ and PRINTER_STATUS_PAPER_PROBLEM) =
PRINTER_STATUS_PAPER_PROBLEM then
Info := "PRINTER_STATUS_PAPER_PROBLEM";
if (adwData^ and PRINTER_STATUS_OFFLINE) =
PRINTER_STATUS_OFFLINE then
Info := "PRINTER_STATUS_OFFLINE";
if (adwData^ and PRINTER_STATUS_IO_ACTIVE) =
PRINTER_STATUS_IO_ACTIVE then
Info := "PRINTER_STATUS_IO_ACTIVE";
if (adwData^ and PRINTER_STATUS_BUSY) =
PRINTER_STATUS_BUSY then
Info := "PRINTER_STATUS_BUSY";
if (adwData^ and PRINTER_STATUS_PRINTING) =
PRINTER_STATUS_PRINTING then
Info := "PRINTER_STATUS_PRINTING";
if (adwData^ and PRINTER_STATUS_OUTPUT_BIN_FULL) =
PRINTER_STATUS_OUTPUT_BIN_FULL then
Info := "PRINTER_STATUS_OUTPUT_BIN_FULL";
if (adwData^ and PRINTER_STATUS_NOT_AVAILABLE) =
PRINTER_STATUS_NOT_AVAILABLE then
Info := "PRINTER_STATUS_NOT_AVAILABLE";
if (adwData^ and PRINTER_STATUS_WAITING) =
PRINTER_STATUS_WAITING then
Info := "PRINTER_STATUS_WAITING";
if (adwData^ and PRINTER_STATUS_PROCESSING) =
PRINTER_STATUS_PROCESSING then
Info := "PRINTER_STATUS_PROCESSING";
if (adwData^ and PRINTER_STATUS_INITIALIZING) =
PRINTER_STATUS_INITIALIZING then
Info := "PRINTER_STATUS_INITIALIZING";
if (adwData^ and PRINTER_STATUS_WARMING_UP) =
PRINTER_STATUS_WARMING_UP then
Info := "PRINTER_STATUS_WARMING_UP";
if (adwData^ and PRINTER_STATUS_TONER_LOW) =
PRINTER_STATUS_TONER_LOW then
Info := "PRINTER_STATUS_TONER_LOW";
if (adwData^ and PRINTER_STATUS_NO_TONER) =
PRINTER_STATUS_NO_TONER then
Info := "PRINTER_STATUS_NO_TONER";
if (adwData^ and PRINTER_STATUS_PAGE_PUNT) =
PRINTER_STATUS_PAGE_PUNT then
Info := "PRINTER_STATUS_PAGE_PUNT";
if (adwData^ and PRINTER_STATUS_USER_INTERVENTION) =
PRINTER_STATUS_USER_INTERVENTION then
Info := "PRINTER_STATUS_USER_INTERVENTION";
if (adwData^ and PRINTER_STATUS_OUT_OF_MEMORY) =
PRINTER_STATUS_OUT_OF_MEMORY then
Info := "PRINTER_STATUS_OUT_OF_MEMORY";
if (adwData^ and PRINTER_STATUS_DOOR_OPEN) =
PRINTER_STATUS_DOOR_OPEN then
Info := "PRINTER_STATUS_DOOR_OPEN";
if (adwData^ and PRINTER_STATUS_SERVER_UNKNOWN) =
PRINTER_STATUS_SERVER_UNKNOWN then
Info := "PRINTER_STATUS_SERVER_UNKNOWN";
if (adwData^ and PRINTER_STATUS_POWER_SAVE) =
PRINTER_STATUS_POWER_SAVE then
Info := "PRINTER_STATUS_POWER_SAVE";
end;
← →
simpson © (2005-03-11 14:56) [10]
PRINTER_NOTIFY_FIELD_STATUS_STRING:
Info := "Состояние: " + StrPas(pBuf);
PRINTER_NOTIFY_FIELD_CJOBS:
Info := "Количество заданий: " +
IntToStr(adwData^);
PRINTER_NOTIFY_FIELD_AVERAGE_PPM:
Info := "Средняя скорость печати, страниц в минуту: " +
IntToStr(adwData^);
end;
end;
JOB_NOTIFY_TYPE:
begin
FError := "Тип: JOB_NOTIFY_TYPE";
Synchronize(WriteInfo);
case p^.aData[I].Field of
JOB_NOTIFY_FIELD_PRINTER_NAME:
Info := "Принтер: " + StrPas(pBuf);
JOB_NOTIFY_FIELD_MACHINE_NAME:
Info := "Компьютер: " + StrPas(pBuf);
JOB_NOTIFY_FIELD_PORT_NAME:
Info := "Порты: " + StrPas(pBuf);
JOB_NOTIFY_FIELD_USER_NAME:
Info := "Пользователь: " + StrPas(pBuf);
JOB_NOTIFY_FIELD_NOTIFY_NAME:
Info := "Кого уведомить: " + StrPas(pBuf);
JOB_NOTIFY_FIELD_DATATYPE:
Info := "Тип данных: " + StrPas(pBuf);
JOB_NOTIFY_FIELD_PRINT_PROCESSOR:
Info := "Имя принт-процессора: " + StrPas(pBuf);
JOB_NOTIFY_FIELD_PARAMETERS:
Info := "Параметры принт-процессора: " + StrPas(pBuf);
JOB_NOTIFY_FIELD_DRIVER_NAME:
Info := "Драйвер: " + StrPas(pBuf);
JOB_NOTIFY_FIELD_DEVMODE:
begin
Info := "JOB_NOTIFY_FIELD_DEVMODE";
end;
JOB_NOTIFY_FIELD_STATUS:
begin
end;
JOB_NOTIFY_FIELD_STATUS_STRING:
Info := "Состояние задания: " + StrPas(pBuf);
JOB_NOTIFY_FIELD_DOCUMENT:
Info := "Имя документа: " + StrPas(pBuf);
JOB_NOTIFY_FIELD_PRIORITY:
Info := "Приоритет задания: " + IntToStr(adwData^);
JOB_NOTIFY_FIELD_POSITION:
Info := "Номер задания: " + IntToStr(adwData^);
JOB_NOTIFY_FIELD_SUBMITTED:
Info := "JOB_NOTIFY_FIELD_SUBMITTED";
JOB_NOTIFY_FIELD_START_TIME:
Info := "JOB_NOTIFY_FIELD_START_TIME";
JOB_NOTIFY_FIELD_UNTIL_TIME:
Info := "JOB_NOTIFY_FIELD_UNTIL_TIME";
JOB_NOTIFY_FIELD_TIME:
Info := "JOB_NOTIFY_FIELD_TIME";
JOB_NOTIFY_FIELD_TOTAL_PAGES:
Info := "Страниц: " + IntToStr(adwData^);
JOB_NOTIFY_FIELD_PAGES_PRINTED:
Info := "Страниц напечатано: " + IntToStr(adwData^);
JOB_NOTIFY_FIELD_TOTAL_BYTES:
Info := "Байт: " + IntToStr(adwData^);
JOB_NOTIFY_FIELD_BYTES_PRINTED:
Info := "Байт напечатано: " + IntToStr(adwData^);
end;
end;
end;
end;
FreePrinterNotifyInfo(Pointer(p));
end;
end;
end;
end;
finally
FindClosePrinterChangeNotification(hNotify);
end;
finally
ClosePrinter(hPrinter);
end;
end;
← →
simpson © (2005-03-11 14:57) [11]
procedure TMonThread.Set_Info(Value: String);
begin
FError := Value;
Synchronize(WriteInfo);
end;
procedure TMonThread.WriteError;
begin
FormMain.PrinterLog.Lines.Insert(0, Format("Ошибка монитора: %s", [FError]));
end;
procedure TMonThread.WriteInfo;
begin
FormMain.PrinterLog.Lines.Insert(0, FError);
end;
end.
Это надо склеить ))) Ибо ограничение длины сообщения.
← →
Separator © (2005-03-11 15:25) [12]ясно))), в принципе то-что нужно. ОГРОМНОЕ СПАСИБО
← →
ssk © (2005-03-11 16:05) [13]очередной велосипед
вот то, что за тебя сделали другие
http://www.internetaccessmonitor.com/eng/products/pam/
← →
simpson © (2005-03-11 16:10) [14]> ssk © (11.03.05 16:05) [13]
Бросаем нах... писать программы, срочно. Ведь все уже написано до нас.
Слов нет. Может быть, человек учится?
Страницы: 1 вся ветка
Форум: "Основная";
Текущий архив: 2005.03.27;
Скачать: [xml.tar.bz2];
Память: 0.59 MB
Время: 0.036 c