我想对打印机进行设置,包括纸张大小之类的。。请问应如何调用系统默认的打印设置窗口?还有,我这儿有个例子,点击“属性”可以显示本地打印机的设置,但不能显示网络打印机的设置。。应如何解决?盼教~
解决方案 »
- [求助]请教高手这个VB程序为什么在任务栏右键菜单点击关闭没有反应?
- 串口通讯,关于如何判定接收到的结束字符
- 如何在固定的document里输入?
- VB编制excel宏的问题?
- 求词频统计器代码
- 在vb中如何获取系统输入法?
- 请大虾指教:怎样实现控件与远程服务器数据的绑定?
- 请大家介绍API的学习方法谢谢。
- 大虾们:急!比如说notepad.exe是用vb做的,运行notepad.exe a.txt,当打开notepad时,怎么得到a.txt这个参数呢?再给20分
- 谁有用VB实现排程功能的源码?
- printer.pagewidth在win98下怎么不起作用??
- 在SQL-Server数据库中误删记录,如何找回?急~~~~~~~~~~在线等.......
The PrintDlg function displays a Print dialog box or a Print Setup dialog box. The Print dialog box enables the user to specify the properties of a particular print job. The Print Setup dialog box should not be used in new applications. It has been superseded by the Page Setup common dialog box created by the PageSetupDlg function. BOOL PrintDlg(
LPPRINTDLG lppd // pointer to structure with initialization data
);
Parameters
lppd
Pointer to a PRINTDLG structure that contains information used to initialize the dialog box. When PrintDlg returns, this structure contains information about the user's selections.
Return Values
If the user clicks the OK button, the return value is nonzero. The members of the PRINTDLG structure pointed to by the lppd parameter indicate the user's selections. If the user canceled or closed the Print or Printer Setup dialog box or an error occurred, the return value is zero. To get extended error information, use the CommDlgExtendedError function. If the user canceled or closed the dialog box, CommDlgExtendedError returns zero; otherwise, it returns one of the following values: CDERR_FINDRESFAILURE PDERR_CREATEICFAILURE
CDERR_INITIALIZATION PDERR_DEFAULTDIFFERENT
CDERR_LOADRESFAILURE PDERR_DNDMMISMATCH
CDERR_LOADSTRFAILURE PDERR_GETDEVMODEFAIL
CDERR_LOCKRESFAILURE PDERR_INITFAILURE
CDERR_MEMALLOCFAILURE PDERR_LOADDRVFAILURE
CDERR_MEMLOCKFAILURE PDERR_NODEFAULTPRN
CDERR_NOHINSTANCE PDERR_NODEVICES
CDERR_NOHOOK PDERR_PARSEFAILURE
CDERR_NOTEMPLATE PDERR_PRINTERNOTFOUND
CDERR_STRUCTSIZE PDERR_RETDEFFAILURE
Res
If the hook procedure (pointed to by the lpfnPrintHook or lpfnSetupHook member of the PRINTDLG structure) processes the WM_CTLCOLORDLG message, the hook procedure must return a handle for the brush that should be used to paint the control background. Windows NT 5.0 and later: You can use the PrintDlgEx function to display a Print property sheet, which has a General page containing controls similar to the Print common dialog box. Windows CE: The PRINTDLG structure contains different members in Windows CE than it does in Windows desktop platforms.PrintDlg
The PrintDlg function displays a Print dialog box or a Print Setup dialog box. The Print dialog box enables the user to specify the properties of a particular print job. The Print Setup dialog box should not be used in new applications. It has been superseded by the Page Setup common dialog box created by the PageSetupDlg function. BOOL PrintDlg(
LPPRINTDLG lppd // pointer to structure with initialization data
);
Parameters
lppd
Pointer to a PRINTDLG structure that contains information used to initialize the dialog box. When PrintDlg returns, this structure contains information about the user's selections.
Return Values
If the user clicks the OK button, the return value is nonzero. The members of the PRINTDLG structure pointed to by the lppd parameter indicate the user's selections. If the user canceled or closed the Print or Printer Setup dialog box or an error occurred, the return value is zero. To get extended error information, use the CommDlgExtendedError function. If the user canceled or closed the dialog box, CommDlgExtendedError returns zero; otherwise, it returns one of the following values: CDERR_FINDRESFAILURE PDERR_CREATEICFAILURE
CDERR_INITIALIZATION PDERR_DEFAULTDIFFERENT
CDERR_LOADRESFAILURE PDERR_DNDMMISMATCH
CDERR_LOADSTRFAILURE PDERR_GETDEVMODEFAIL
CDERR_LOCKRESFAILURE PDERR_INITFAILURE
CDERR_MEMALLOCFAILURE PDERR_LOADDRVFAILURE
CDERR_MEMLOCKFAILURE PDERR_NODEFAULTPRN
CDERR_NOHINSTANCE PDERR_NODEVICES
CDERR_NOHOOK PDERR_PARSEFAILURE
CDERR_NOTEMPLATE PDERR_PRINTERNOTFOUND
CDERR_STRUCTSIZE PDERR_RETDEFFAILURE
Res
If the hook procedure (pointed to by the lpfnPrintHook or lpfnSetupHook member of the PRINTDLG structure) processes the WM_CTLCOLORDLG message, the hook procedure must return a handle for the brush that should be used to paint the control background. Windows NT 5.0 and later: You can use the PrintDlgEx function to display a Print property sheet, which has a General page containing controls similar to the Print common dialog box. Windows CE: The PRINTDLG structure contains different members in Windows CE than it does in Windows desktop platforms.
"PrintDlgA" (pPrintdlg As PRINTDLG) As Long
Type PRINTDLG
lStructSize As Long
hwndOwner As Long
hDevMode As Long
hDevNames As Long
hdc As Long
flags As Long
nFromPage As Integer
nToPage As Integer
nMinPage As Integer
nMaxPage As Integer
nCopies As Integer
hInstance As Long
lCustData As Long
lpfnPrintHook As Long
lpfnSetupHook As Long
lpPrintTemplateName As String
lpSetupTemplateName As String
hPrintTemplate As Long
hSetupTemplate As Long
End Type使用:
Private Sub Command1_Click()
Dim p As PRINTDLG
p.lStructSize = Len(p)
p.hwndOwner = Me.hWnd
p.nFromPage = 1
p.nToPage = 1
p.nMinPage = 1
p.nMaxPage = 1
p.nCopies = 1
x = PRINTDLG(p)
Printer.Print Text1.Text
End Sub
yourCD.showprint