青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

面對現實,超越自己
逆水行舟,不進則退
posts - 269,comments - 32,trackbacks - 0

獲取驅動相關文件列表可用DRIVER_INFO_3,GetPrinterDriver

MSDN中解釋:

DRIVER_INFO_3

The DRIVER_INFO_3 structure contains printer driver information.

typedef struct _DRIVER_INFO_3 { 
  DWORD  cVersion; 
  LPTSTR pName; 
  LPTSTR pEnvironment; 
  LPTSTR pDriverPath; 
  LPTSTR pDataFile; 
  LPTSTR pConfigFile; 
  LPTSTR pHelpFile; 
  LPTSTR pDependentFiles; 
  LPTSTR pMonitorName; 
  LPTSTR pDefaultDataType; 
} DRIVER_INFO_3, *PDRIVER_INFO_3; 

Members

cVersion
Specifies the operating system version for which the driver was written. It can be one of the following.
Value Meaning
0 Driver for Windows 95/98/Me.
2 Driver for Windows NT 4.0.
3 Driver for Windows 2000/XP.

pName
Pointer to a null-terminated string that specifies the name of the driver (for example, "QMS 810").
pEnvironment
Pointer to a null-terminated string that specifies the environment for which the driver was written (for example, Windows NT x86, Windows IA64, Windows x64, Windows NT R4000, Windows NT Alpha_AXP, Windows 4.0, or Windows NT PowerPC).
Note Windows IA64 is available in Windows XP, Windows XP 64-Bit Edition, Windows Server 2003, and later versions. Windows x64 is available in Windows XP Service Pack 2 (SP2), Windows XP Professional x64 Edition, Windows Server 2003 Service Pack 1 (SP1), and later versions.
pDriverPath
Pointer to a null-terminated string that specifies a file name or full path and file name for the file that contains the device driver (for example, "C:\DRIVERS\Pscript.dll").
pDataFile
Pointer to a null-terminated string that specifies a file name or a full path and file name for the file that contains driver data (for example, "C:\DRIVERS\Qms810.ppd").
pConfigFile
Pointer to a null-terminated string that specifies a file name or a full path and file name for the device driver's configuration dynamic-link library (for example, "C:\DRIVERS\Pscrptui.dll").
pHelpFile
Pointer to a null-terminated string that specifies a file name or a full path and file name for the device driver's help file.
pDependentFiles
Pointer to a null-terminated string that specifies the files the driver is dependent on. Each file name in the string is also terminated with a null (for example, "Pscript.dll\0Qms810.PPD\0Pscrptui.dll\0Pspcriptui.hlp\0Pstest.txt\0\0").
pMonitorName
Pointer to a null-terminated string that specifies a language monitor (for example, "PJL monitor"). This member can be NULL and should be specified only for printers capable of bidirectional communication.
pDefaultDataType
Pointer to a null-terminated string that specifies the default data type of the print job (for example, "EMF").

Requirements

  Windows NT/2000/XP/Vista: Included in Windows NT 4.0 and later.
  Windows 95/98/Me: Included in Windows 95 and later.
  Header: Declared in Winspool.h; include Windows.h.
  Unicode: Declared as Unicode and ANSI structures.

GetPrinterDriver

The GetPrinterDriver function retrieves driver data for the specified printer. If the driver is not installed on the local computer, GetPrinterDriver installs it.

BOOL GetPrinterDriver(
  HANDLE hPrinter,     // printer object
  LPTSTR pEnvironment, // environment name
  DWORD Level,         // information level
  LPBYTE pDriverInfo,  // driver data buffer
  DWORD cbBuf,         // size of buffer
  LPDWORD pcbNeeded    // bytes received or required
);

Parameters

hPrinter
[in] Handle to the printer for which the driver data should be retrieved. Use the OpenPrinter or AddPrinter function to retrieve a printer handle.
pEnvironment
[in] Pointer to a null-terminated string that specifies the environment (for example, Windows NT x86, Windows IA64, Windows x64, Windows NT R4000, Windows NT Alpha_AXP, Windows 4.0, or Windows NT PowerPC). If this parameter is NULL, the current environment of the calling application and client machine (not of the destination application and print server) is used.
Note Windows IA64 is available in Windows XP, Windows XP 64-Bit Edition, Windows Server 2003, and later versions. Windows x64 is available in Windows XP Service Pack 2 (SP2), Windows XP Professional x64 Edition, Windows Server 2003 Service Pack 1 (SP1), and later versions.
Level
[in] Specifies the printer driver structure returned in the pDriverInfo buffer. This parameter can be one of the following values.
Level Structure
1 DRIVER_INFO_1
2 DRIVER_INFO_2
3 Windows 95/98/Me, Windows NT4.0 and later: DRIVER_INFO_3
4 Windows 2000/XP: DRIVER_INFO_4
5 Windows 2000/XP: DRIVER_INFO_5
6 Windows Me, Windows 2000/XP: DRIVER_INFO_6

pDriverInfo
[out] Pointer to a buffer that receives a structure containing information about the driver, as specified by Level. The buffer must be large enough to store the strings pointed to by the structure members.

To determine the required buffer size, call GetPrinterDriver with cbBuf set to zero. GetPrinterDriver fails, GetLastError returns ERROR_INSUFFICIENT_BUFFER, and the pcbNeeded parameter returns the size, in bytes, of the buffer required to hold the array of structures and their data.

cbBuf
[in] Specifies the size, in bytes, of the array at which pDriverInfo points.
pcbNeeded
[out] Pointer to a value that receives the number of bytes copied if the function succeeds or the number of bytes required if cbBuf is too small.

Return Values

If the function succeeds, the return value is a nonzero value.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Windows 95/98/Me: For a non-existent driver, the function returns ERROR_INVALID_NAMES.

Windows NT/2000/XP: For a non-existent driver, the function returns ERROR_UNKNOWN_PRINTER_DRIVER.

Remarks

The DRIVER_INFO_2, DRIVER_INFO_3, DRIVER_INFO_4, DRIVER_INFO_5, and DRIVER_INFO_6 structures contain the file name or the full path and file name of the printer driver in the pDriverPath member. An application can use the path and file name to load a printer driver by calling the LoadLibrary function and supplying the path and file name as the single argument.

Requirements

  Windows NT/2000/XP/Vista: Included in Windows NT 3.1 and later.
  Windows 95/98/Me: Included in Windows 95 and later.
  Header: Declared in Winspool.h; include Windows.h.
  Library: Use Winspool.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000/XP.


相關代碼:

 1 BOOL CCommonFun::GetPrinterDriverInfo(HANDLE hPrinter, CStringArray &arsDriverFiles, CString &sDriverInstallPath)
 2 {
 3     DWORD dwNeed = 0;
 4     BOOL bOK = GetPrinterDriver(hPrinter, NULL, 3, NULL, NULL, &dwNeed);
 5     if (dwNeed > 0)
 6     {
 7         BYTE *pData = new BYTE[dwNeed];
 8 
 9         bOK = GetPrinterDriver(hPrinter, NULL, 3, pData, dwNeed, &dwNeed);
10         if(bOK)
11         {
12             DRIVER_INFO_3 *pInfo3 = (DRIVER_INFO_3*)pData;
13             sDriverInstallPath = GetFilePath(pInfo3->pDriverPath);
14             if (sDriverInstallPath.IsEmpty())
15             {
16                 return FALSE;
17             }
18             //GetFileList
19             arsDriverFiles.Add(GetFileFullName(pInfo3->pDriverPath));            
20             arsDriverFiles.Add(GetFileFullName(pInfo3->pDataFile));        
21             arsDriverFiles.Add(GetFileFullName(pInfo3->pConfigFile));
22             arsDriverFiles.Add(GetFileFullName(pInfo3->pHelpFile));
23 
24             LPSTR __pdependentFiles = pInfo3->pDependentFiles;
25             CString dependentFiles;
26             //get dependent files
27             if (__pdependentFiles)
28             {
29                 while (__pdependentFiles[0!= '\0')
30                 {
31                     dependentFiles = GetFileFullName(__pdependentFiles);
32                     arsDriverFiles.Add(dependentFiles);
33                     __pdependentFiles += (strlen(__pdependentFiles)+1);
34                 }
35             }
36         }
37         else
38         {
39             return FALSE;
40         }
41 
42         delete []pData;
43     }
44     else
45     {
46         return FALSE;
47     }
48 
49     return TRUE;
50 }

 

posted on 2012-09-04 17:51 王海光 閱讀(615) 評論(0)  編輯 收藏 引用 所屬分類: MFC
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            国产欧美日韩在线视频| 欧美日韩精品一二三区| 国产日本亚洲高清| 久久gogo国模裸体人体| 亚洲午夜视频| 国产午夜亚洲精品不卡| 久久精品亚洲国产奇米99| 欧美伊久线香蕉线新在线| 国内成人精品视频| 欧美电影打屁股sp| 欧美日韩18| 欧美一区二区三区另类| 欧美一区二区视频在线观看| 18成人免费观看视频| 亚洲黄色天堂| 国产精品99一区| 久久精品综合| 欧美连裤袜在线视频| 香蕉av福利精品导航| 久久九九热re6这里有精品| 亚洲电影毛片| 亚洲天堂视频在线观看| 国产综合18久久久久久| 亚洲精品乱码久久久久久久久| 欧美视频中文在线看| 久久久久国色av免费看影院| 另类av导航| 亚洲欧美色婷婷| 久久伊伊香蕉| 欧美一级视频精品观看| 蜜臀a∨国产成人精品| 午夜精品久久久久久久99热浪潮 | 欧美一区二区精品久久911| 久久国产精品久久w女人spa| 99re6热只有精品免费观看| 亚洲欧美一区二区原创| 亚洲精品自在在线观看| 欧美一区二区三区日韩| 亚洲人成网站777色婷婷| 亚洲综合国产激情另类一区| 亚洲理论在线| 久久久欧美一区二区| 亚洲一区三区在线观看| 欧美激情欧美狂野欧美精品| 久久激情视频久久| 国产精品国产自产拍高清av| 亚洲国产精品热久久| 国内精品美女在线观看| 亚洲欧美日韩人成在线播放| 夜夜爽99久久国产综合精品女不卡| 久久九九热re6这里有精品 | 激情小说亚洲一区| 亚洲午夜精品福利| 国产精品99久久久久久白浆小说| 麻豆精品视频在线观看| 老司机免费视频久久| 国产欧美69| 欧美一区二区三区四区夜夜大片 | 国产欧美亚洲日本| 亚洲午夜日本在线观看| 亚洲嫩草精品久久| 欧美三级视频在线播放| 亚洲精品综合| 亚洲深夜影院| 欧美日韩国产三区| 99re6热在线精品视频播放速度| 亚洲精品一品区二品区三品区| 快射av在线播放一区| 欧美顶级艳妇交换群宴| 最新高清无码专区| 欧美精品三级在线观看| 一本久久精品一区二区| 亚洲午夜伦理| 国产精品美女主播在线观看纯欲| 一区二区三区毛片| 午夜精品在线观看| 国产日韩亚洲欧美精品| 久久精品99| 欧美777四色影视在线| 亚洲黄色三级| 欧美理论电影在线播放| 亚洲一级在线观看| 久久精品二区三区| 在线观看欧美亚洲| 欧美激情1区2区3区| 日韩午夜电影av| 欧美一区二区日韩| 国内精品久久久| 欧美电影资源| 亚洲无限乱码一二三四麻| 久久乐国产精品| 亚洲免费高清| 国产女人aaa级久久久级| 久久青青草原一区二区| 亚洲另类自拍| 久久久亚洲综合| 99re6热只有精品免费观看 | 国产欧美精品va在线观看| 久久久久se| 一本色道久久综合亚洲91| 久久夜色精品亚洲噜噜国产mv| 亚洲精品在线三区| 国产欧美日韩激情| 欧美精品免费在线| 欧美一区二区成人6969| 亚洲激情网站| 久久aⅴ乱码一区二区三区| 国产精品久久久久久影视 | 一本一本久久a久久精品综合妖精| 欧美精品免费在线| 亚洲欧美另类久久久精品2019| 久久久精品国产免大香伊| 亚洲第一狼人社区| 国产免费成人在线视频| 久久伊人一区二区| 国产精品99久久99久久久二8 | 一区二区三区成人| 国产视频在线一区二区| 午夜一区二区三区在线观看 | 亚洲精品网址在线观看| 国产精品丝袜白浆摸在线| 久久久亚洲人| 性欧美video另类hd性玩具| 亚洲电影免费观看高清完整版在线观看| 一本一本大道香蕉久在线精品| 国产欧美一区二区三区久久| 欧美高清在线精品一区| 先锋影音久久久| 夜夜嗨av色一区二区不卡| 免费成人黄色片| 亚洲欧美日韩国产精品| 亚洲精品欧美激情| 国产亚洲精品久久久久动| 久久蜜臀精品av| 欧美怡红院视频| 亚洲午夜免费福利视频| 亚洲精品美女在线观看播放| 久久伊人亚洲| 亚洲欧美日韩在线| 午夜精品一区二区三区电影天堂| 亚洲欧洲日本一区二区三区| 国产亚洲精品激情久久| 欧美三级视频在线播放| 欧美激情在线播放| 久久gogo国模啪啪人体图| 久久精品导航| 亚洲国产影院| 99re6热在线精品视频播放速度| 国产日韩精品一区观看| 宅男在线国产精品| 欧美日韩精品欧美日韩精品一| 欧美电影免费观看高清完整版| 国内综合精品午夜久久资源| 亚洲黄网站黄| 国产亚洲在线| 久久人体大胆视频| 亚洲国产另类 国产精品国产免费| 国产午夜亚洲精品不卡| 欧美综合国产| 狼狼综合久久久久综合网| 激情成人综合网| 亚洲国产欧美日韩| 一区二区三区欧美激情| 欧美精品亚洲一区二区在线播放| 欧美黄网免费在线观看| 亚洲一区二区三区精品在线观看| 国产精品国产| 欧美综合国产| 亚洲三级影院| 久久久久久穴| 一区二区三区 在线观看视频| 欧美日韩精品一区视频| 亚洲福利视频三区| 一区二区三区|亚洲午夜| 国产麻豆综合| 久久久精品一品道一区| 亚洲精品免费在线观看| 免费视频一区| 欧美成人精品| 久久国产一区| 欧美一区二区三区在线视频| 日韩亚洲在线观看| 国精品一区二区| 国产在线播放一区二区三区| 欧美国产欧美亚洲国产日韩mv天天看完整 | 亚洲二区在线观看| 国产一区二区三区精品久久久 | 亚洲国产精品成人精品| 国产精品久久91| 欧美日韩高清在线| 免费看精品久久片| 久久亚洲精品伦理| 欧美激情日韩| 国产精品大全| 国产欧亚日韩视频| 精久久久久久久久久久| 亚洲精品视频免费在线观看| 亚洲日本中文字幕| 中文在线资源观看视频网站免费不卡| 夜夜嗨av一区二区三区 |