资源简介

每一个打印任务在发送给打印机前都会将任务压缩成制定文件(SHD, SPL)一个为打印任务信息,另外一个为任务压缩文档(类似压缩bitmap)。这就为我们除了HOOK打印函数、注册打印消息、生成虚拟打印机接替系统打印任务托管外又提供了一个获取打印任务相关信息的方法,并且其获取的信息更加全面.这里提供了可以解析spool的工具以及根据其方法自己编写的解析spool文件的示例代码,虽然不是很全面,但是只要看明白,剩下的均可自己实现。

资源截图

代码片段和文件信息

#include “stdafx.h“
using namespace std;

#define BUF_SIZE 1024

BOOL AnalyseFile(const char* pszFileName);

void PFT(const char* pszInfoDWORD dwData)
{
    printf(“%s: 0x%08X\n“pszInfodwData);
}

void PFM(const char* pszInfo)
{
    printf(“%s\n“pszInfo);
}

void UPFM(const wchar_t pszInfo[])
{
    wprintf(L“%s\n“pszInfo);
}

static char* ID_Func[] =
{
“EMR_HEADER“
“EMR_POLYBEZIER“
“EMR_POLYGON“
“EMR_POLYLINE“
“EMR_POLYBEZIERTO“
“EMR_POLYLINETO“
“EMR_POLYPOLYLINE“
“EMR_POLYPOLYGON“
“EMR_SETWINDOWEXTEX“         
“EMR_SETWINDOWORGEX“         
“EMR_SETVIEWPORTEXTEX“        
“EMR_SETVIEWPORTORGEX“        
“EMR_SETBRUSHORGEX“            
“EMR_EOF“                       
“EMR_SETPIXELV“                 
“EMR_SETMAPPERFLAGS“           
“EMR_SETMAPMODE“               
“EMR_SETBKMODE“                  
“EMR_SETPOLYFILLMODE“            
“EMR_SETROP2“                   
“EMR_SETSTRETCHBLTMODE“          
“EMR_SETTEXTALIGN“               
“EMR_SETCOLORADJUSTMENT“        
“EMR_SETTEXTCOLOR“              
“EMR_SETBKCOLOR“                
“EMR_OFFSETCLIPRGN“            
“EMR_MOVETOEX“                  
“EMR_SETmetaRGN“                 
“EMR_EXCLUDECLIPRECT“          
“EMR_INTERSECTCLIPRECT“          
“EMR_SCALEVIEWPORTEXTEX“        
“EMR_SCALEWINDOWEXTEX“           
“EMR_SAVEDC“                     
“EMR_RESTOREDC“                  
“EMR_SETWORLDTRANSFORM“         
“EMR_MODIFYWORLDTRANSFORM“       
“EMR_SELECTobject“               
“EMR_CREATEPEN“                   
“EMR_CREATEBRUSHINDIRECT“       
“EMR_DELETEobject“               
“EMR_ANGLEARC“                    
“EMR_ELLIPSE“                   
“EMR_RECTANGLE“                  
“EMR_ROUNDRECT“                
“EMR_ARC“                        
“EMR_CHORD“                     
“EMR_PIE“                        
“EMR_SELECTPALETTE“            
“EMR_CREATEPALETTE“               
“EMR_SETPALETTEENTRIES“           
“EMR_RESIZEPALETTE“              
“EMR_REALIZEPALETTE“              
“EMR_EXTFLOODFILL“               
“EMR_LINETO“                     
“EMR_ARCTO“                      
“EMR_POLYDRAW“                  
“EMR_SETARCDIRECTION“          
“EMR_SETMITERLIMIT“              
“EMR_BEGINPATH“                
“EMR_ENDPATH“                  
“EMR_CLOSEFIGURE“               
“EMR_FILLPATH“                   
“EMR_STROKEANDFILLPATH“           
“EMR_STROKEPATH“               
“EMR_FLATTENPATH“               
“EMR_WIDENPATH“                  
“EMR_SELECTCLIPPATH“             
“EMR_ABORTPATH“
“69--Unknown“

“EMR_GDICOMMENT“
“EMR_FILLRGN“
“EMR_frameRGN“
“EMR_INVERTRGN“
“EMR_PAINTRGN “
“EMR_EXTSELECTCLIPRGN“
“EMR_BITBLT “
“EMR_STRETCHBLT“
“EMR_MASKBLT“
“EMR_PLGBLT“
“EMR_SETDIBITSTODEVICE“
“EMR_STRETCHDIBITS“
“EMR_EXTCREATEFONTINDIRECTW“
“EMR_EXTTEXTOUTA “
“EMR_EXTTEXTOUTW“
“EMR_POLYBEZIER16“
“EMR_POLYGON16 “
“EMR_POLYLINE1

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件   28332032  2013-02-22 14:43  SPL_Split_Test\SPL_Split_Test.sdf

     文件        909  2013-02-20 16:38  SPL_Split_Test\SPL_Split_Test.sln

     文件      16896  2013-02-22 14:43  SPL_Split_Test\SPL_Split_Test.suo

     文件      36352  2013-02-22 13:33  SPL_Split_Test\Debug\SPL_Split_Test.exe

     文件     442504  2013-02-22 13:33  SPL_Split_Test\Debug\SPL_Split_Test.ilk

     文件    1911808  2013-02-22 13:33  SPL_Split_Test\Debug\SPL_Split_Test.pdb

     文件   45744128  2013-02-22 13:36  SPL_Split_Test\ipch\spl_split_test-48e9aa76\spl_split_test-a5e4da65.ipch

     文件       1764  2013-02-20 16:38  SPL_Split_Test\SPL_Split_Test\ReadMe.txt

     文件       8460  2013-02-22 14:43  SPL_Split_Test\SPL_Split_Test\SPL_Split_Test.cpp

     文件       4380  2013-02-20 16:38  SPL_Split_Test\SPL_Split_Test\SPL_Split_Test.vcxproj

     文件       1338  2013-02-20 16:38  SPL_Split_Test\SPL_Split_Test\SPL_Split_Test.vcxproj.filters

     文件        384  2013-02-22 13:33  SPL_Split_Test\SPL_Split_Test\SPL_Split_Test.vcxproj.user

     文件        301  2013-02-20 16:38  SPL_Split_Test\SPL_Split_Test\stdafx.cpp

     文件        428  2013-02-20 16:59  SPL_Split_Test\SPL_Split_Test\stdafx.h

     文件        314  2013-02-20 16:38  SPL_Split_Test\SPL_Split_Test\targetver.h

     文件       1498  2013-02-22 13:33  SPL_Split_Test\SPL_Split_Test\Debug\cl.command.1.tlog

     文件      20800  2013-02-22 13:33  SPL_Split_Test\SPL_Split_Test\Debug\CL.read.1.tlog

     文件        810  2013-02-22 13:33  SPL_Split_Test\SPL_Split_Test\Debug\CL.write.1.tlog

     文件          2  2013-02-22 13:33  SPL_Split_Test\SPL_Split_Test\Debug\link-cvtres.read.1.tlog

     文件          2  2013-02-22 13:33  SPL_Split_Test\SPL_Split_Test\Debug\link-cvtres.write.1.tlog

     文件          2  2013-02-22 13:33  SPL_Split_Test\SPL_Split_Test\Debug\link.3660-cvtres.read.1.tlog

     文件          2  2013-02-22 13:33  SPL_Split_Test\SPL_Split_Test\Debug\link.3660-cvtres.write.1.tlog

     文件          2  2013-02-22 13:33  SPL_Split_Test\SPL_Split_Test\Debug\link.3660.read.1.tlog

     文件          2  2013-02-22 13:33  SPL_Split_Test\SPL_Split_Test\Debug\link.3660.write.1.tlog

     文件          2  2013-02-22 13:33  SPL_Split_Test\SPL_Split_Test\Debug\link.3712-cvtres.read.1.tlog

     文件          2  2013-02-22 13:33  SPL_Split_Test\SPL_Split_Test\Debug\link.3712-cvtres.write.1.tlog

     文件          2  2013-02-22 13:33  SPL_Split_Test\SPL_Split_Test\Debug\link.3712.read.1.tlog

     文件          2  2013-02-22 13:33  SPL_Split_Test\SPL_Split_Test\Debug\link.3712.write.1.tlog

     文件       1672  2013-02-22 13:33  SPL_Split_Test\SPL_Split_Test\Debug\link.command.1.tlog

     文件       3076  2013-02-22 13:33  SPL_Split_Test\SPL_Split_Test\Debug\link.read.1.tlog

............此处省略34个文件信息

评论

共有 条评论