看看MSDN嘛!用词霸!
hdc
[in] Handle to the device context.
nEscape
[in] Specifies the escape function to be performed. This parameter must be one of the predefined escape values listed in the Res section. Use the ExtEscape function if your application defines a private escape value.
cbInput
[in] Specifies the number of bytes of data pointed to by the lpvInData parameter.
lpvInData
[in] Pointer to the input structure required for the specified escape.
lpvOutData
[out] Pointer to the structure that receives output from this escape. This parameter should be NULL if no data is returned.
你说的那些nEscape是给16位程序用的,现在已废弃了。32位程序一般只用两个:
QUERYESCSUPPORT: Determines whether a particular escape is implemented by the device driver.
PASSTHROUGH: Allows the application to send data directly to a printer.
hdc
[in] Handle to the device context.
nEscape
[in] Specifies the escape function to be performed. This parameter must be one of the predefined escape values listed in the Res section. Use the ExtEscape function if your application defines a private escape value.
cbInput
[in] Specifies the number of bytes of data pointed to by the lpvInData parameter.
lpvInData
[in] Pointer to the input structure required for the specified escape.
lpvOutData
[out] Pointer to the structure that receives output from this escape. This parameter should be NULL if no data is returned.
你说的那些nEscape是给16位程序用的,现在已废弃了。32位程序一般只用两个:
QUERYESCSUPPORT: Determines whether a particular escape is implemented by the device driver.
PASSTHROUGH: Allows the application to send data directly to a printer.
说明
一个灵活的设备控制函数
返回值
Long,对于QUERYESCSUPPORT,如支持指定的换码,则返回TRUE(非零);否则返回零。对于PASSTHROUGH,大于零值表示成功;如指定的换码不支持,则返回零;如果出错,则返回负值
参数表
参数 类型及说明
hdc Long,设备场景的句柄
nEscape Long,换码数量,由API32.TXT文件中的一个常数定义。这决定了具体的运作方式。请参考注解
nCount Long,lpInData缓冲区的大小,用字节数表示
lpInData String,由换码类型决定。对于QUERYESCSUPPORT,这代表指向一个整数变量的指针,那个变量包含了要测试的换码值。对于PASSTHROUGH,这代表指向一个数据块的指针,那个数据块包含于要发送数据的头16位字节数量中。数据块剩余的部分包含了要发送给打印机的实际数据缓冲区
lpOutData Any,指定一个输出缓冲区,它的具体使用由换码决定。它不由QUERYESCSUPPORT或PASSTHROUGH使用,而且应设为NULL(ByVal 0&)
注解
只有两个换码在Win32环境中经常用到。请用QUERYESCSUPPORT换码判断一个换码是否得到了驱动程序的支持。用PASSTHROUGH换码将原始数据直接发给一台打印机。其他换码在Win32仍然得到了支持,但目的只是为了与Win16保持兼容