<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2878479</guid>
        <pubDate>Tue, 19 Apr 2011 07:30:02 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2878479</link>
        <description><![CDATA[DC-AC: Возьмите в драйвере конкретного принтера поставьте галку &quot;Печатать в файл&quot;. Получившийся prn анализируйте, исходя из типа принтера. Например, prn-файл при печати драйвером струйных Эпсонов содержит управляющие коды (на двух языках управления принтером) и растровую графику, как правило в формате ESC i r  c  b  nL nH mL mH d1...dk. В виде графики печатается и любой текст (из Word, например). При печати на лазерниках, поддерживающих PCL, есть шанс перехватить текст в явном виде. В .bmp - это вряд ли получится. Пути решения задачи можно прояснить, если знать четкую постановку задачи и список предполагаемых принтеров.]]></description>
        <author>DC-AC</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2876115</guid>
        <pubDate>Thu, 14 Apr 2011 19:51:27 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2876115</link>
        <description><![CDATA[sorokin.dmitr: Привет всем&#33;<br>Мне нужно перехватить данные с принтера и сохранить их в файл (BMP, например), для последующей обработки (данные при этом до принтера доходить не должны)... В каком виде можно эти данные перехватить? В каком формате посылаются данные на принтер? Какие возможны пути решения этой проблемы?]]></description>
        <author>sorokin.dmitr</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2620437</guid>
        <pubDate>Mon, 14 Jun 2010 15:04:24 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2620437</link>
        <description><![CDATA[VahaC: Я думаю что программисты тоже не знают что вам делать с этими файлами]]></description>
        <author>VahaC</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2620377</guid>
        <pubDate>Mon, 14 Jun 2010 14:00:53 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2620377</link>
        <description><![CDATA[reflexible: Здрастуйте&#33;&#33;&#33; У меня такая же проблема,мне надо паралельно с печатью на принтере сохранять документ в файле (word, excel, bmp). Я не програмист потому попрошу чтобы вы мне подсказали что я с этими файлами должен делать. Заранее благодарен. Жду ответа.]]></description>
        <author>reflexible</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2532097</guid>
        <pubDate>Fri, 12 Mar 2010 11:36:08 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2532097</link>
        <description><![CDATA[Pacha: Да нет&#33; Я в мирных целях. Для блага пользователя. User хочет сохранять и распечатывать, но не хочет на это всё смотреть. <br>Типа автоматически.]]></description>
        <author>Pacha</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2531750</guid>
        <pubDate>Fri, 12 Mar 2010 07:47:53 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2531750</link>
        <description><![CDATA[aster_x: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=91865&view=findpost&p=2531693'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Pacha &#064; <time class="tag-quote__quoted-time" datetime="2010-03-12T07:08:23+00:00">12.03.10, 07:08</time></span><div class='quote '>тайно от пользователя в свою папку и потом отправить на печать?</div></div><br>
Я хаккеров не обучаю.<br>
<br>
Хотя ели на печать то ВАРИАНТ2]]></description>
        <author>aster_x</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2531693</guid>
        <pubDate>Fri, 12 Mar 2010 07:08:23 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2531693</link>
        <description><![CDATA[Pacha: <strong class='tag-b'>aster_x</strong>, еще можно вопросик? А как сохранить документ в Worde тайно от пользователя в свою папку и потом отправить на печать?]]></description>
        <author>Pacha</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2530748</guid>
        <pubDate>Thu, 11 Mar 2010 11:39:04 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2530748</link>
        <description><![CDATA[Pacha: <strong class='tag-b'>aster_x</strong>&#33; Спасибо огромное&#33; Выручил на все сто&#33;&#33;&#33;]]></description>
        <author>Pacha</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2530659</guid>
        <pubDate>Thu, 11 Mar 2010 10:38:58 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2530659</link>
        <description><![CDATA[aster_x: Скидаю пример&#33;<br>Может поможет.]]></description>
        <author>aster_x</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2530357</guid>
        <pubDate>Thu, 11 Mar 2010 07:50:27 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2530357</link>
        <description><![CDATA[Pacha: <strong class='tag-b'>aster_x</strong>,спасибо за инфу. Я сделал через OLE, но встал вопрос, когда я вызываю окно Сохранить как, то оно появляется. Всё нормально, но когда я пытаюсь вызвать его для этого же документа второй раз, то он у меня просто сохраняется. Не знаешь, почему? На всякий случай скину код<br>
&lt;code&gt;<br>
procedure WordSave();<br>
const<br>
  wdPromptUser=&#036;00000002;<br>
var<br>
  ServerIsRunning:Boolean;<br>
  Unknown:IUnknown;<br>
  Result:HResult;<br>
  AppProgId:string;<br>
  App:Variant;<br>
begin<br>
  AppProgId:=&#39;Word.Application&#39;;<br>
  ServerIsRunning:=False;<br>
  Result:=GetActiveObject(ProgIdToClassId(AppProgId),nil,Unknown);<br>
  if Result=MK_E_UNAVAILABLE then App:=CreateOleObject(AppProgId)<br>
  else<br>
  begin<br>
  App:=GetActiveOleObject(AppProgId);<br>
  ServerIsRunning:=true;<br>
  end;<br>
  App.Visable:=true;<br>
  App.ActiveDocument.Save; //когда здесь пишу App.ActiveDocument.Save(false,wdPromptUser)<br>
                             то выскакивает ошибка на серевере.Использую позднее связывание. <br>
App.ActiveDocument.PrintOut;<br>
<br>
end;<br>
&lt;/code&gt;]]></description>
        <author>Pacha</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2529509</guid>
        <pubDate>Wed, 10 Mar 2010 14:10:33 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2529509</link>
        <description><![CDATA[aster_x: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=91865&view=findpost&p=2529332'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Pacha &#064; <time class="tag-quote__quoted-time" datetime="2010-03-10T12:11:48+00:00">10.03.10, 12:11</time></span><div class='quote '>Документы Word,Excel,Блокнот</div></div><br>
Тогда только один выход <strong class='tag-b'> OLE </strong>.<br>
<br>
<br>
И тебе в ручную прийдется писать алгоритм параллелного сохранения.<br>
<br>
<a class='tag-url' href='http://forum.sources.ru/index.php?showforum=191' target='_blank'>Зайди сюда</a>]]></description>
        <author>aster_x</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2529332</guid>
        <pubDate>Wed, 10 Mar 2010 12:11:48 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2529332</link>
        <description><![CDATA[Pacha: Документы Word,Excel,Блокнот]]></description>
        <author>Pacha</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2529204</guid>
        <pubDate>Wed, 10 Mar 2010 10:47:54 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2529204</link>
        <description><![CDATA[aster_x: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=91865&view=findpost&p=2528892'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Pacha &#064; <time class="tag-quote__quoted-time" datetime="2010-03-10T06:37:38+00:00">10.03.10, 06:37</time></span><div class='quote '>разделенном на два, мог выбрать принтер для печати и файл, куда сохранить. При нажатии на печать,</div></div><br>
Если картинку то вариант я тебе дал.<br>
<br>
Тебе нужно сохранить картинку? или даные какого формата?]]></description>
        <author>aster_x</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2528892</guid>
        <pubDate>Wed, 10 Mar 2010 06:37:38 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2528892</link>
        <description><![CDATA[Pacha: Поясню задание: мне надо, чтобы пользователь в одном окне, разделенном на два, мог выбрать принтер для печати и файл, куда сохранить. При нажатии на печать, инфа должна распечататься и сохраниться в файл. Если есь мысли как сделать, буду рад их услышать.]]></description>
        <author>Pacha</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2528342</guid>
        <pubDate>Tue, 09 Mar 2010 14:59:25 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2528342</link>
        <description><![CDATA[aster_x: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=91865&view=findpost&p=2528156'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Pacha &#064; <time class="tag-quote__quoted-time" datetime="2010-03-09T12:43:47+00:00">09.03.10, 12:43</time></span><div class='quote '>Надо что-бы печать сохранялась в файле и одновременно печаталось на принтер.</div></div><br>
Тебе нужно что бы оно прямо с принтера сохранялось?<br>
<br>
Или Что бы то что ты отрправляешь печататься ишло в файл.<br>
Если так то<br>
<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">procedure TForm1.Button1Click(Sender: TObject);</div><div class="code_line">var b:TBitmap;</div><div class="code_line">begin</div><div class="code_line">try</div><div class="code_line">&nbsp;&nbsp; &nbsp; b:=TBitmap.Create;</div><div class="code_line">&nbsp;&nbsp; &nbsp; b.Height:=100;</div><div class="code_line">&nbsp;&nbsp; &nbsp; b.Width:=100;</div><div class="code_line">&nbsp;&nbsp; &nbsp; b.Canvas.Rectangle(10,10,50,50);</div><div class="code_line">&nbsp;&nbsp; &nbsp; b.SaveToFile(&#39;c:.bmp&#39;);</div><div class="code_line">&nbsp;&nbsp;finally</div><div class="code_line">&nbsp;&nbsp; &nbsp; b.Free;</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">end;</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script><br>
Только на БИТМАП рисуй то что рисуешь на принтерер.]]></description>
        <author>aster_x</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2528156</guid>
        <pubDate>Tue, 09 Mar 2010 12:43:47 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2528156</link>
        <description><![CDATA[Pacha: Ошибка как-то сама исчезла. Выдавало ошибку №87. Но сейчас всё нормально. Сейчас назрел новый вопрос. Надо что-бы печать сохранялась в файле и одновременно печаталось на принтер. Не подскажешь куда копать?]]></description>
        <author>Pacha</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2525229</guid>
        <pubDate>Fri, 05 Mar 2010 15:13:09 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2525229</link>
        <description><![CDATA[Rouse_: Извиняюсь, я сейчас редко бываю на форуме. Где именно ошибка? Вот тут?<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&nbsp; &nbsp;hChanges := FindFirstPrinterChangeNotification(hPrinter, PRINTER_CHANGE_JOB,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;0, @NotifyOption);</div><div class="code_line">&nbsp;&nbsp; &nbsp;if hChanges = INVALID_HANDLE_VALUE then</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;ShowMessage(&#39;Ошибка&#39;)</div></ol></div></div></div></div><br>
<br>
Если да, то оставь как и было, т.е. RaiseLastOSError и смотри что выводится, ну и на основании этих данных смотри где именно ляп.]]></description>
        <author>Rouse_</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2523207</guid>
        <pubDate>Thu, 04 Mar 2010 07:23:04 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=2523207</link>
        <description><![CDATA[Pacha: Всем привет&#33; Rouse, сделал всё по-твоему примеру, но у меня почему-то при создании объекта уведомления выдает ошибку. Если не трудно посмотри, пожалуйста, может я что-то пропустил?<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">unit Otlov;</div><div class="code_line">&nbsp;</div><div class="code_line">interface</div><div class="code_line">uses</div><div class="code_line">Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,</div><div class="code_line">&nbsp;&nbsp;Dialogs, StdCtrls, WinSpool;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">type</div><div class="code_line">&nbsp;&nbsp;TForm1 = class(TForm)</div><div class="code_line">&nbsp;&nbsp; &nbsp;btnStart: TButton;</div><div class="code_line">&nbsp;&nbsp; &nbsp;cbPrinters: TComboBox;</div><div class="code_line">&nbsp;&nbsp; &nbsp;procedure FormCreate(Sender: TObject);</div><div class="code_line">&nbsp;&nbsp; &nbsp;procedure btnStartClick(Sender: TObject);</div><div class="code_line">&nbsp;&nbsp;private</div><div class="code_line">&nbsp;&nbsp; &nbsp;{ Private declarations }</div><div class="code_line">&nbsp;&nbsp;public</div><div class="code_line">&nbsp;&nbsp; &nbsp;{ Public declarations }</div><div class="code_line">&nbsp;&nbsp;end;</div><div class="code_line">&nbsp;</div><div class="code_line">var</div><div class="code_line">&nbsp;&nbsp;Form1: TForm1;</div><div class="code_line">&nbsp;</div><div class="code_line">implementation</div><div class="code_line">&nbsp;</div><div class="code_line">{$R *.dfm}</div><div class="code_line">&nbsp;</div><div class="code_line">procedure TForm1.btnStartClick(Sender: TObject);</div><div class="code_line">var</div><div class="code_line">&nbsp;&nbsp;hPrinter, hChanges: THandle;</div><div class="code_line">&nbsp;&nbsp;NotifyOption: TPrinterNotifyOptions;</div><div class="code_line">&nbsp;&nbsp;NotifyTipes: TPrinterNotifyOptionsType;</div><div class="code_line">&nbsp;&nbsp;Field: TPrinterNotifyInfoData;</div><div class="code_line">&nbsp;&nbsp;JobInfo, TmpJobInfo: PJobInfo3;</div><div class="code_line">&nbsp;&nbsp;pcReturned, jpcbNeeded, jpcReturned, JobId: DWORD;</div><div class="code_line">&nbsp;&nbsp;pcbNeeded:PDWORD;</div><div class="code_line">&nbsp;&nbsp;j:integer;</div><div class="code_line">&nbsp;&nbsp;pJob:^JOB_INFO_1;</div><div class="code_line">&nbsp;&nbsp;pDocument:Pointer;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;if OpenPrinter(PChar(cbPrinters.Items.Strings[cbPrinters.ItemIndex]),</div><div class="code_line">&nbsp;&nbsp; &nbsp;hPrinter, nil) then</div><div class="code_line">&nbsp;&nbsp;try</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;NotifyTipes.wType := JOB_NOTIFY_TYPE;</div><div class="code_line">&nbsp;&nbsp; &nbsp;NotifyTipes.Reserved0 := 0;</div><div class="code_line">&nbsp;&nbsp; &nbsp;NotifyTipes.Reserved1 := 0;</div><div class="code_line">&nbsp;&nbsp; &nbsp;NotifyTipes.Reserved2 := 0;</div><div class="code_line">&nbsp;&nbsp; &nbsp;NotifyTipes.Count := 1;</div><div class="code_line">&nbsp;&nbsp; &nbsp;NotifyTipes.pFields := @Field;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;NotifyOption.Version := 2;</div><div class="code_line">&nbsp;&nbsp; &nbsp;NotifyOption.Flags := PRINTER_CHANGE_ALL;</div><div class="code_line">&nbsp;&nbsp; &nbsp;NotifyOption.Count := 1;</div><div class="code_line">&nbsp;&nbsp; &nbsp;NotifyOption.pTypes := @NotifyTipes;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;hChanges := FindFirstPrinterChangeNotification(hPrinter, PRINTER_CHANGE_JOB,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;0, @NotifyOption);</div><div class="code_line">&nbsp;&nbsp; &nbsp;if hChanges = INVALID_HANDLE_VALUE then</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;ShowMessage(&#39;Ошибка&#39;)</div><div class="code_line">&nbsp;&nbsp; &nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp;try</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;case WaitForSingleObject(hChanges, INFINITE) of</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;WAIT_OBJECT_0:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if EnumJobs(hPrinter, 0, 100, 3, JobInfo,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;jpcbNeeded, jpcbNeeded, jpcReturned) then</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TmpJobInfo := JobInfo;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;JobId:=TmpJobInfo^.JobId;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for J := 0 to jpcReturned - 1 do</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;GetJob(hPrinter,JobId,1,pJob,0,pcbNeeded);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pDocument:=pJob.pDocument;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ShowMessage(&#39;Есть изменения&#39;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;WAIT_FAILED: RaiseLastOSError;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;end;</div><div class="code_line">&nbsp;&nbsp; &nbsp;finally</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;FindClosePrinterChangeNotification(hChanges);</div><div class="code_line">&nbsp;&nbsp; &nbsp;end;</div><div class="code_line">&nbsp;&nbsp;finally</div><div class="code_line">&nbsp;&nbsp; &nbsp;ClosePrinter(hPrinter);</div><div class="code_line">&nbsp;&nbsp;end</div><div class="code_line">&nbsp;&nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp;ShowMessage(&#39;Никак&#39;)</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">procedure TForm1.FormCreate(Sender: TObject);</div><div class="code_line">var</div><div class="code_line">&nbsp;&nbsp;PrintersInfo: array of TPrinterInfo5;</div><div class="code_line">&nbsp;&nbsp;I, Needed, Returned: DWORD;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;EnumPrinters(PRINTER_ENUM_LOCAL, nil, 5, nil,</div><div class="code_line">&nbsp;&nbsp; &nbsp;0, Needed, Returned);</div><div class="code_line">&nbsp;&nbsp;SetLength(PrintersInfo, Needed div SizeOf(TPrinterInfo5));</div><div class="code_line">&nbsp;&nbsp;if EnumPrinters(PRINTER_ENUM_LOCAL, nil, 5, PrintersInfo,</div><div class="code_line">&nbsp;&nbsp; &nbsp;Needed, Needed, Returned) then</div><div class="code_line">&nbsp;&nbsp; &nbsp;if Returned &#62; 0 then</div><div class="code_line">&nbsp;&nbsp; &nbsp;begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;for I := 0 to Returned - 1 do</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cbPrinters.Items.Add(PrintersInfo[I].pPrinterName);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;btnStart.Enabled := True;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;cbPrinters.ItemIndex := 1;</div><div class="code_line">&nbsp;&nbsp; &nbsp;end;</div><div class="code_line">end;</div></ol></div></div></div></div>]]></description>
        <author>Pacha</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=1986082</guid>
        <pubDate>Sun, 15 Jun 2008 09:17:19 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=1986082</link>
        <description><![CDATA[Rouse_: WM_DEVICECHANGE и там смотри список принтеров...]]></description>
        <author>Rouse_</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=1968386</guid>
        <pubDate>Mon, 26 May 2008 10:45:33 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=1968386</link>
        <description><![CDATA[Cyr: А как быть если нужно отслеживать появление нового принтера?<br>Какой handle hPrinter должен быть? Ведь принтера нет :wall:]]></description>
        <author>Cyr</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=688529</guid>
        <pubDate>Wed, 20 Apr 2005 06:22:45 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=688529</link>
        <description><![CDATA[Rouse_: Вот накидал на скорую руку, дальше развивай по аналогии:<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">unit Unit1;</div><div class="code_line">&nbsp;</div><div class="code_line">interface</div><div class="code_line">&nbsp;</div><div class="code_line">uses</div><div class="code_line">&nbsp;&nbsp;Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,</div><div class="code_line">&nbsp;&nbsp;Dialogs, StdCtrls, WinSpool;</div><div class="code_line">&nbsp;</div><div class="code_line">type</div><div class="code_line">&nbsp;&nbsp;TForm1 = class(TForm)</div><div class="code_line">&nbsp;&nbsp; &nbsp;btnStart: TButton;</div><div class="code_line">&nbsp;&nbsp; &nbsp;cbPrinters: TComboBox;</div><div class="code_line">&nbsp;&nbsp; &nbsp;procedure btnStartClick(Sender: TObject);</div><div class="code_line">&nbsp;&nbsp; &nbsp;procedure FormCreate(Sender: TObject);</div><div class="code_line">&nbsp;&nbsp;end;</div><div class="code_line">&nbsp;</div><div class="code_line">var</div><div class="code_line">&nbsp;&nbsp;Form1: TForm1;</div><div class="code_line">&nbsp;</div><div class="code_line">implementation</div><div class="code_line">&nbsp;</div><div class="code_line">{$R *.dfm}</div><div class="code_line">&nbsp;</div><div class="code_line">procedure TForm1.FormCreate(Sender: TObject);</div><div class="code_line">var</div><div class="code_line">&nbsp;&nbsp;PrintersInfo: array of TPrinterInfo5;</div><div class="code_line">&nbsp;&nbsp;I, Needed, Returned: DWORD;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;EnumPrinters(PRINTER_ENUM_LOCAL, nil, 5, nil,</div><div class="code_line">&nbsp;&nbsp; &nbsp;0, Needed, Returned);</div><div class="code_line">&nbsp;&nbsp;SetLength(PrintersInfo, Needed div SizeOf(TPrinterInfo5));</div><div class="code_line">&nbsp;&nbsp;if EnumPrinters(PRINTER_ENUM_LOCAL, nil, 5, PrintersInfo,</div><div class="code_line">&nbsp;&nbsp; &nbsp;Needed, Needed, Returned) then</div><div class="code_line">&nbsp;&nbsp; &nbsp;if Returned &#62; 0 then</div><div class="code_line">&nbsp;&nbsp; &nbsp;begin</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;for I := 0 to Returned - 1 do</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cbPrinters.Items.Add(PrintersInfo[I].pPrinterName);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;btnStart.Enabled := True;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;cbPrinters.ItemIndex := 1;</div><div class="code_line">&nbsp;&nbsp; &nbsp;end;</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">procedure TForm1.btnStartClick(Sender: TObject);</div><div class="code_line">var</div><div class="code_line">&nbsp;&nbsp;hPrinter, hChanges: THandle;</div><div class="code_line">&nbsp;&nbsp;NotifyOption: TPrinterNotifyOptions;</div><div class="code_line">&nbsp;&nbsp;NotifyTipes: TPrinterNotifyOptionsType;</div><div class="code_line">&nbsp;&nbsp;Field: TPrinterNotifyInfoData;</div><div class="code_line">begin</div><div class="code_line">&nbsp;&nbsp;if OpenPrinter(PChar(cbPrinters.Items.Strings[cbPrinters.ItemIndex]),</div><div class="code_line">&nbsp;&nbsp; &nbsp;hPrinter, nil) then</div><div class="code_line">&nbsp;&nbsp;try</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;NotifyTipes.wType := JOB_NOTIFY_TYPE;</div><div class="code_line">&nbsp;&nbsp; &nbsp;NotifyTipes.Reserved0 := 0;</div><div class="code_line">&nbsp;&nbsp; &nbsp;NotifyTipes.Reserved1 := 0;</div><div class="code_line">&nbsp;&nbsp; &nbsp;NotifyTipes.Reserved2 := 0;</div><div class="code_line">&nbsp;&nbsp; &nbsp;NotifyTipes.Count := 1;</div><div class="code_line">&nbsp;&nbsp; &nbsp;NotifyTipes.pFields := @Field;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;NotifyOption.Version := 2;</div><div class="code_line">&nbsp;&nbsp; &nbsp;NotifyOption.Flags := PRINTER_CHANGE_ALL;</div><div class="code_line">&nbsp;&nbsp; &nbsp;NotifyOption.Count := 1;</div><div class="code_line">&nbsp;&nbsp; &nbsp;NotifyOption.pTypes := @NotifyTipes;</div><div class="code_line">&nbsp;&nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;hChanges := FindFirstPrinterChangeNotification(hPrinter, PRINTER_CHANGE_ALL,</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;0, @NotifyOption);</div><div class="code_line">&nbsp;&nbsp; &nbsp;if hChanges = INVALID_HANDLE_VALUE then</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;RaiseLastOSError</div><div class="code_line">&nbsp;&nbsp; &nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp;try</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;case WaitForSingleObject(hChanges, INFINITE) of</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;WAIT_OBJECT_0: ShowMessage(&#39;Есть изменения&#39;);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;WAIT_FAILED: RaiseLastOSError;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;end;</div><div class="code_line">&nbsp;&nbsp; &nbsp;finally</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;FindClosePrinterChangeNotification(hChanges);</div><div class="code_line">&nbsp;&nbsp; &nbsp;end;</div><div class="code_line">&nbsp;&nbsp;finally</div><div class="code_line">&nbsp;&nbsp; &nbsp;ClosePrinter(hPrinter);</div><div class="code_line">&nbsp;&nbsp;end;</div><div class="code_line">end;</div><div class="code_line">&nbsp;</div><div class="code_line">end.</div></ol></div></div></div></div>]]></description>
        <author>Rouse_</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=688203</guid>
        <pubDate>Tue, 19 Apr 2005 18:28:56 +0000</pubDate>
        <title>Перехватывать печать на принтере</title>
        <link>https://forum.sources.ru/index.php?showtopic=91865&amp;view=findpost&amp;p=688203</link>
        <description><![CDATA[SkyLight: Нужно перехватывать печать на принтере: на каком принтере, какой документ, сколько страниц распечатали.<br>Нашёл, что надо использовать FindFirstPrinterChangeNotification.<br>Может у кого нибудь есть пример рабочего кода?]]></description>
        <author>SkyLight</author>
        <category>Delphi: Система, Windows API</category>
      </item>
	
      </channel>
      </rss>
	