如何获得当前打印机支持的纸张的列表?

jojojk 2005-08-10 02:27:00
问下:
如何获得当前打印机支持的纸张的列表?有什么简便的方法吗?
谢谢!
...全文
199 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
hrfzjl 2005-08-28
  • 打赏
  • 举报
回复
lb_2.reset()
string printerName
string paperList
long bufferlen = 0
boolean rt
long p1,p2
p1=1
p2=0
if lb_1.TotalItems ( )<=0 then
messagebox("","没有打印机列表,请执行<获得打印机列表>功能")
return
end if
printerName = lb_1.SelectedItem ()
if printerName="" then
messagebox("","请选择一个打印机!")
return
end if
rt = GetPaperList(ref printerName, ref paperList, ref bufferlen)
if (Not rt) and bufferlen>0 then
paperList = space(bufferLen)
rt = GetPaperList(ref printerName, ref paperList, ref bufferlen)
if rt then
p2 = pos(paperlist,"~t",p1)
do while p2>0
lb_2.additem(mid(paperlist,p1,p2 - p1))
p1 = p2+1
p2 = pos(paperlist,"~t",p1)
loop
end if
else
messagebox("","调用函数出错!")
end if
(注:其中lb_1,lb_2是列表框,分别存储纸张和所有打印机,函数GetPaperList是PrintCtrl.dll中的函数,原形申明为:Function Boolean GetPaperList(ref string Printer, ref string PaperList, ref long bufferLen) library "PrintCtrl.dll")
hl8189 2005-08-28
  • 打赏
  • 举报
回复
关注
Awang_126 2005-08-28
  • 打赏
  • 举报
回复
关注

680

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder API 调用
社区管理员
  • API 调用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧