📄 print monitor that prints into a directory rating.mht
字号:
=
href=3D"http://www.codeguru.com/RealMedia/ads/click_lx.ads/ew/ewsoftware/=
www.codeguru.com/cpp/w-p/printing/article/c5893/i/1861081252/336x280/OasD=
efault/IBM_Business_Values_GEMS_1g/IBM_IBV_BOBIII.html/643365393164623034=
34303434323530?index.php/1716_def%20"><B><SPAN=20
style=3D"COLOR: black">CRM Done Right</SPAN></B><SPAN=20
style=3D"COLOR: black"><BR></SPAN></A></SPAN><SPAN =
lang=3DEN-US=20
style=3D"FONT-SIZE: 11pt; COLOR: #0000cc; FONT-FAMILY: =
Verdana">Improve=20
the likelihood of CRM success from less than 20 percent to =
60=20
percent.</SPAN><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 11pt; COLOR: black; FONT-FAMILY: =
Verdana">=20
<BR><BR>WHITEPAPER : <BR><A=20
=
href=3D"http://www.codeguru.com/RealMedia/ads/click_lx.ads/ew/ewsoftware/=
www.codeguru.com/cpp/w-p/printing/article/c5893/i/1861081252/336x280/OasD=
efault/IBM_Business_Values_GEMS_1g/IBM_IBV_BOBIII.html/643365393164623034=
34303434323530?index.php/1716_cfo%20"><B><SPAN=20
style=3D"COLOR: black">CFO's Rising to the Challenge of =
Performance=20
Management </SPAN></B><SPAN=20
style=3D"COLOR: black"><BR></SPAN></A></SPAN><SPAN =
lang=3DEN-US=20
style=3D"FONT-SIZE: 11pt; COLOR: #0000cc; FONT-FAMILY: =
Verdana">Summarizes=20
the results of the IBM Business Consulting Services CFO=20
Survey.</SPAN><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 11pt; COLOR: black; FONT-FAMILY: =
Verdana">=20
<BR><BR>SURVEY : <BR><A=20
=
href=3D"http://www.codeguru.com/RealMedia/ads/click_lx.ads/ew/ewsoftware/=
www.codeguru.com/cpp/w-p/printing/article/c5893/i/1861081252/336x280/OasD=
efault/IBM_Business_Values_GEMS_1g/IBM_IBV_BOBIII.html/643365393164623034=
34303434323530?index.php/1716_cen%20"><B><SPAN=20
style=3D"COLOR: black">The 2005 Chief Procurement Officer=20
Survey</SPAN></B><SPAN=20
style=3D"COLOR: black"><BR></SPAN></A></SPAN><SPAN =
lang=3DEN-US=20
style=3D"FONT-SIZE: 11pt; COLOR: #0000cc; FONT-FAMILY: =
Verdana">Highlights=20
several strategic imperatives that are fundamentally =
altering the=20
role of procurement.</SPAN><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 11pt; COLOR: black; FONT-FAMILY: =
Verdana">=20
<o:p></o:p></SPAN></P></TD>
<TD=20
style=3D"PADDING-RIGHT: 6pt; PADDING-LEFT: 6pt; =
PADDING-BOTTOM: 6pt; PADDING-TOP: 6pt">
<P class=3DMsoNormal><![if =
!supportEmptyParas]><![endif]> <SPAN=20
lang=3DEN-US style=3D"FONT-SIZE: =
10pt"><o:p></o:p></SPAN></P></TD>
<TD=20
style=3D"PADDING-RIGHT: 6pt; PADDING-LEFT: 6pt; =
PADDING-BOTTOM: 6pt; PADDING-TOP: 6pt">
<P class=3DMsoNormal><![if =
!supportEmptyParas]><![endif]> <SPAN=20
lang=3DEN-US=20
style=3D"FONT-SIZE: =
10pt"><o:p></o:p></SPAN></P></TD></TR></TBODY></TABLE></DIV>
<P class=3DMsoNormal style=3D"TEXT-ALIGN: center" =
align=3Dcenter><SPAN=20
lang=3DEN-US style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana"><!--[if gte vml 1]><v:shape=20
id=3D_x0000_i1030 style=3D"WIDTH: 0.75pt; HEIGHT: 0.75pt" type =3D =
"#_x0000_t75"=20
coordsize =3D "21600,21600" alt =3D ""><v:imagedata src =3D=20
=
"./Print%20monitor%20that%20prints%20into%20a%20directory.files/image003.=
gif"=20
o:href =3D=20
=
"http://www.codeguru.com/RealMedia/ads/adstream_lx.cgi/ew/ewsoftware/www.=
codeguru.com/cpp/w-p/printing/article/c5893/i/1861081252/336x280/OasDefau=
lt/IBM_Business_Values_GEMS_1g/IBM_IBV_BOBIII.html/6433653931646230343430=
3434323530?_RM_EMPTY_%20"></v:imagedata></v:shape><![endif]--><![if =
!vml]><img border=3D0 width=3D1 height=3D1
=
src=3D"./Print%20monitor%20that%20prints%20into%20a%20directory.files/ima=
ge003.gif"
v:shapes=3D"_x0000_i1030"><![endif]><o:p></o:p></SPAN></P>
<P style=3D"TEXT-ALIGN: center" align=3Dcenter><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: Verdana"><A=20
=
href=3D"http://www.codeguru.com/RealMedia/ads/click_lx.cgi/ew/ewsoftware/=
www.codeguru.com/cpp/w-p/printing/article/c5893/i/1149532333/accessunit/O=
asDefault/default/empty.gif/64336539316462303434303434323530"=20
target=3D_top><SPAN style=3D"TEXT-DECORATION: none; =
text-underline: none"><!--[if gte vml 1]><v:shape=20
id=3D_x0000_i1031 style=3D"WIDTH: 1.5pt; HEIGHT: 1.5pt" type =3D =
"#_x0000_t75"=20
coordsize =3D "21600,21600" alt =3D "" href =3D=20
=
"http://www.codeguru.com/RealMedia/ads/click_lx.cgi/ew/ewsoftware/www.cod=
eguru.com/cpp/w-p/printing/article/c5893/i/1149532333/accessunit/OasDefau=
lt/default/empty.gif/64336539316462303434303434323530"=20
target =3D "_top" o:button =3D "t"><v:imagedata src =3D=20
=
"./Print%20monitor%20that%20prints%20into%20a%20directory.files/image003.=
gif"=20
o:href =3D=20
=
"http://www.codeguru.com/RealMedia/ads/Creatives/OasDefault/default/empty=
.gif"></v:imagedata></v:shape><![endif]--><![if !vml]><img border=3D0 =
width=3D2 height=3D2
=
src=3D"./Print%20monitor%20that%20prints%20into%20a%20directory.files/ima=
ge004.gif"
v:shapes=3D"_x0000_i1031"><![endif]></SPAN></A><!--[if gte vml =
1]><v:shape=20
id=3D_x0000_i1032 style=3D"WIDTH: 0.75pt; HEIGHT: 0.75pt" type =3D =
"#_x0000_t75"=20
coordsize =3D "21600,21600" alt =3D ""><v:imagedata src =3D=20
=
"./Print%20monitor%20that%20prints%20into%20a%20directory.files/image003.=
gif"=20
o:href =3D=20
=
"http://www.codeguru.com/RealMedia/ads/adstream_lx.cgi/ew/ewsoftware/www.=
codeguru.com/cpp/w-p/printing/article/c5893/i/1149532333/accessunit/OasDe=
fault/default/empty.gif/64336539316462303434303434323530?_RM_EMPTY_"></v:=
imagedata></v:shape><![endif]--><![if !vml]><img border=3D0 width=3D1 =
height=3D1
=
src=3D"./Print%20monitor%20that%20prints%20into%20a%20directory.files/ima=
ge003.gif"
v:shapes=3D"_x0000_i1032"><![endif]><o:p></o:p></SPAN></P>
<P><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: Verdana">After =
studying=20
the MSDN I found "The Print Monitor API" (refer to this for =
further=20
information) which explains how to implement a print monitor. A =
print=20
monitor is a DLL that exports some specific functions to enable =
the print=20
spooler to do customized tasks--for example to print not to a =
printer but=20
into a directory.<o:p></o:p></SPAN></P>
<P><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: Verdana">I =
used the=20
print monitor example from the Microsoft DDK as a template to =
implement=20
this print monitor. The example in the DDK was very complicated =
and did=20
more than I wanted it to do (it should just redirect the print =
jobs into=20
appropriate files).<o:p></o:p></SPAN></P>
<P><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana">Notice that the=20
file WINSPLP.H was shipped with the Microsoft Windows NT 4.0 DDK.=20
<o:p></o:p></SPAN></P>
<DIV class=3DMsoNormal style=3D"TEXT-ALIGN: center" =
align=3Dcenter><SPAN=20
class=3Dbodycopy1><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; FONT-FAMILY: Verdana">
<HR align=3Dcenter width=3D"100%" SIZE=3D2>
</SPAN></SPAN></DIV>
<H4><SPAN lang=3DEN-US=20
style=3D"COLOR: black; FONT-FAMILY: =
Verdana">PORTLIST.CPP:<o:p></o:p></SPAN></H4>
<P class=3DMsoNormal><SPAN class=3Dbodycopy1><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; FONT-FAMILY: Verdana">The heart of the =
our monitor=20
is the CPortList class. It...</SPAN></SPAN><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana"><BR><SPAN=20
class=3Dbodycopy1>...stores all ports in the registry. =
</SPAN><BR><SPAN=20
class=3Dbodycopy1>...loads the ports from the registry at start-up =
of the=20
spooler-service.</SPAN><BR><SPAN class=3Dbodycopy1>...holds all =
handles to=20
opened files.</SPAN><BR><SPAN class=3Dbodycopy1>...supplies a list =
of all=20
known ports to MyEnumPorts.</SPAN><BR><SPAN=20
class=3Dbodycopy1>...<o:p></o:p></SPAN></SPAN></P>
<P><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: Verdana">Refer =
to source=20
code for detailed information. <o:p></o:p></SPAN></P>
<DIV class=3DMsoNormal style=3D"TEXT-ALIGN: center" =
align=3Dcenter><SPAN=20
class=3Dbodycopy1><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; FONT-FAMILY: Verdana">
<HR align=3Dcenter width=3D"100%" SIZE=3D2>
</SPAN></SPAN></DIV>
<H4><SPAN lang=3DEN-US=20
style=3D"COLOR: black; FONT-FAMILY: =
Verdana">MONITOR.CPP:<o:p></o:p></SPAN></H4>
<P class=3DMsoNormal><SPAN class=3Dbodycopy1><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; FONT-FAMILY: Verdana">It supplies all =
functions=20
that are exported from the DLL: <o:p></o:p></SPAN></SPAN></P>
<P><B><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana">InitializePrintMonitor</SPAN></B><SPAN=20
lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana"><BR>Called by=20
the spooler-service to obtain pointers to all the other functions, =
and to=20
do some init tasks, of course. <o:p></o:p></SPAN></P>
<P><B><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana">MyEnumPorts</SPAN></B><SPAN=20
lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana"><BR>Called by=20
the spooler-service to obtain a list of the ports of our print =
monitor=20
<o:p></o:p></SPAN></P>
<P><B><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana">MyOpenPort</SPAN></B><SPAN=20
lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana"><BR>Called by=20
the spooler-service to open the port <o:p></o:p></SPAN></P>
<P><B><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana">MyStartDocPort</SPAN></B><SPAN=20
lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana"><BR>Called by=20
the spooler-service to start the printing of a print job. This =
will create=20
a new file in the ports output directory and keep a handle to the =
opened=20
file. <o:p></o:p></SPAN></P>
<P><B><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana">MyWritePort</SPAN></B><SPAN=20
lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana"><BR>Called by=20
the spooler-service to write to the port. This will write some =
data to the=20
file. Will be called more than once. <o:p></o:p></SPAN></P>
<P><B><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana">MyReadPort</SPAN></B><SPAN=20
lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana"><BR>Supplied,=20
but not implemented (no need for) <o:p></o:p></SPAN></P>
<P><B><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana">MyEndDocPort</SPAN></B><SPAN=20
lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana"><BR>Called by=20
the spooler-service to write to the port. Called after all the =
data is=20
written to the file. This will close the file. =
<o:p></o:p></SPAN></P>
<P><B><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana">MyClosePort</SPAN></B><SPAN=20
lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana"><BR>Called by=20
the spooler-service to close the port <o:p></o:p></SPAN></P>
<P><B><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana">MyAddPort</SPAN></B><SPAN=20
lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana"><BR>Called by=20
the spooler service to add a new port. The user has to specify the =
output=20
directory. <o:p></o:p></SPAN></P>
<P><B><SPAN lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana">MyAddPortEx</SPAN></B><SPAN=20
lang=3DEN-US=20
style=3D"FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: =
Verdana"><BR>supplied,=20
but not implemented (no need for) <o:p></o:p></SPAN></P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -