Win32 API的打印不要求用户输入 [英] Win32 API Print not asking user input

查看:276
本文介绍了Win32 API的打印不要求用户输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一些像安全打印

我去我的控制面板>>打印机和设备>>打印机>>打印机preference在这里,我分配一个4位数的PIN code ..

I go to my control panel >> Printers and Devices >> Printer >> Printer Preference Here i assign a 4 digit pin code ..

我火从​​Word或Excel打印...进入打印机>>检索>>作业我选择的打印作业和输入个人识别码code。

I fire a print from Word or Excel ... go to the printer >> retrieve jobs >> select my print job and enter my pin code.

只有这样,我的工作被打印出来。

Only then my job gets printed.

现在我们的应用程序有两种来源$ C ​​$ CS打印

Now Our application has two source codes for printing

虽然从我们的应用射击打印打印瞬间完成​​,即....它不是我的工作在队列中存储,等待脚......但只是立即打印

While firing print from our Application the print is instantaneously done .... I.e. it doesn't store my job in the queue and wait for pin ... but just prints immediately

某些源$ C ​​$ C

Some source code

bResult = OpenPrinter(szDevice, &hPrinter, NULL);
// szDevice contains printer name
startDocPrtInfo.pDocName = msg;
startDocPrtInfo.pOutputFile = NULL;
startDocPrtInfo.pDatatype = "RAW";
bPrntErr = (StartDocPrinter(hPrinter,1,(LPBYTE)&startDocPrtInfo) == 0);

WritePrinter(hPrinter, &buffer[2], i, &cnt);
EndDocPrinter(hPrinter);
ClosePrinter(hPrinter);

在code然而打印给定文档它不是等待用户输入自己的脚code

The Code is printing the given document however its not waiting for user to enter his pin code

问题如何作出上述code等待就像它正在为其他应用程序?在那里,我很想念这里一些设置?

QUESTION How to make the above code wait just like its doing for other applications ? is there some setting that I am missing here ?

给你更多的细节。

我们有,它作为desierd ..即同一应用程序的另一个打印子程序等待用户输入其PIN

We have another Print subroutine in the same application that works as desierd .. I.e. waits for User to enter his PIN

不过子程序使用的TextOut方法,而不是WritePrinter

However the subroutine uses TextOut method instead of WritePrinter

任何想法,为什么当我使用印刷的方法WritePrinter打印不候?

Any idea why print is not waiting when i use the WritePrinter methods of printing?

谢谢预测CP

推荐答案

我解决了这个。

没有code变化。
在我们的打印机设置,我们需要取消选中允许转义序列

There is NO CODE CHANGES. In our Printer Settings, we need to UNCHECK the "Allow Escape Sequence"

感谢论坛寿招待的问题。

Thanks to the forum tho for entertaining the question.

将与更多的问题和决议,以别人提出问题经常访问

Will visit often with more questions and resolutions to Questions that others raise

好运
一个无知的程序员:)

Good Luck A Clueless Programmer :)

这篇关于Win32 API的打印不要求用户输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆