请教四个问题,共计200大洋,先谢了!(200分)

  • 主题发起人 主题发起人 holly888
  • 开始时间 开始时间
H

holly888

Unregistered / Unconfirmed
GUEST, unregistred user!
在DELPHI中如何实现<br>1如何设定“短日期格式”为yyyy-MM-dd?<br>2如何通过打印机名字找到打印机,并将其删除?<br>3如何判断CHM文件之中,某一个页面是否存在?<br>4论坛中一老问题,但谈得不是很清除,即如何使用enter键代替tab键实现焦点的跳转?<br>现问题是因为窗体中可能包含EDIT和MEMO控件,当然在EDIT中跳转较容易,但有MEMO控件<br>后想使用CTRL+ENTER键进行跳转,不知如何实现?<br>烦请高手指点。谢谢!<br>
 
1、改系统的格式吗?这个可能很难做到,最好是自己用函数格式化日期字符串了;<br>2、用API函数也许可以;<br>4、如果Memo中不需要编辑而直接就跳的话,判断一下直接发送Ctrl-Enter即可。
 
日期格式好像你可以在建表时就可以设定了
 
1)<br>可以在控制面板中手工修改区域设置, 日期改为 yyyy-mm-dd 类型即可<br>程序中修改:<br><br>//强制写日期格式<br>&nbsp; try<br>&nbsp; &nbsp; htwWriteRegisry('sShortDate','yyyy-MM-dd' ,HKEY_CURRENT_USER, '/Control Panel/International');<br>&nbsp; &nbsp; htwWriteRegisry('sShortDate','yyyy-MM-dd' ,HKEY_USERS, '/.DEFAULT/Control Panel/International');<br>&nbsp; &nbsp; setlocaleinfo(LOCALE_SYSTEM_DEFAULT,LOCALE_SDATE,'yyyy-MM-dd');<br>&nbsp; except<br>&nbsp; end;<br>&nbsp; DateSeparator := '-';<br>&nbsp; shortdateformat:='yyyy-mm-dd';<br>&nbsp; ShortTimeFormat:='hh:mm:ss';<br>&nbsp; s:=application.UpdateFormatSettings;<br><br><br>function htwReadRegisry( RegKey :string ; Default :string ; MyRootKey : Hkey; &nbsp;MyOpenKey :string): string &nbsp;;<br>var<br>&nbsp; &nbsp;Registry: TRegistry;<br>&nbsp; &nbsp;S : string;<br>begin<br>&nbsp; &nbsp;Registry:= TRegistry.Create;<br>&nbsp; &nbsp;try<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Registry.RootKey :=MyRootKey; &nbsp; // HKEY_CURRENT_USER;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Registry.OpenKey(MYOpenKey,false); &nbsp;// Registry.OpenKey('/Software/MachineAdministrator',false);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;S := Registry.ReadString(RegKey);<br>&nbsp; &nbsp; &nbsp; end<br>&nbsp; &nbsp;finally<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Registry.CloseKey;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Registry.Free;<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp; &nbsp; if Trim(S)='' &nbsp;then Result := Default<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;else &nbsp; Result := S;<br>&nbsp; &nbsp;end;<br><br>end;<br><br>procedure htwWriteRegisry(RegKey :string ;asValueTobewrited : string; MyRootKey : Hkey; &nbsp;MyOpenKey :string );<br>var<br>&nbsp; &nbsp;Registry: TRegistry;<br>begin<br>&nbsp; &nbsp;Registry:= TRegistry.Create;<br>&nbsp; &nbsp;try<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Registry.RootKey :=MyRootKey; // HKEY_CURRENT_USER;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Registry.OpenKey(MyOpenKey,true); //Registry.OpenKey('/Software/MachineAdministrator',true);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Registry.WriteString(RegKey,asValueTobewrited);<br>&nbsp; &nbsp; &nbsp; end<br>&nbsp; &nbsp;finally<br>&nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Registry.CloseKey;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Registry.Free;<br>&nbsp; &nbsp; &nbsp; end;<br>&nbsp; &nbsp;end;<br>end;<br><br><br><br>4)在控件的keypress事件中加入以下代码,注意你可以按下Ctrl或shift一次选中多个控件<br>if key=#13 then<br>&nbsp; &nbsp; &nbsp; &nbsp; postmessage(self.handle,wm_keydown,vk_tab,0);<br><br>2)<br>Api函数列表 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>--与打印相关 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>Api函数名 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 函数说明 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;适用范围 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; W3.x W95 NT<br>AddPrinterConnection &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;为当前用户建立与打印机的联系 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>StartPagePrinter &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;开始打印机 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>StartDoc &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;开始打印作业 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;是 是 是<br>StartDocPrinter &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 开始打印作业 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>AddPrintProvidor &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;加入一个打印机支持器 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>AddForm &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 加入一个打印机窗体 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>AddPort &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 加入一个打印机端口 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>AddMonitor &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;加入一个打印机管理器 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>ShellExecute &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;打开或打印指定文件 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>ClosePrinter &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;关闭打开的打印机 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>WritePrinter &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;向打印机输出数据 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>AddPrinter &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;在打印机服务器上建立一个打印机 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>SetAbortProc &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;设备打印作业的放弃函数 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>SetPrinter &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;设置打印机信息 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>SetPrinterData &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;设置打印机配置 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>SetJob &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;设置打印作业信息 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>ResetPrinter &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;设置打印数据类型和设备模式值 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>DeletePrinterConnection &nbsp; &nbsp; &nbsp; 删除与打印机的连接 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>DeletePrintProcessor &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;删除打印机处理器 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>DeletePrinterDriver &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 删除打印机驱动程序 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>DeletePrinter &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 删除打印机服务器上的打印机 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>DeleteMonitor &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 删除打印机监视器 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>DeletePrintProvidor &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 删除打印机提供者 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>DeleteForm &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;删除打印机窗体层差 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>AbortPrinter &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;删除打印机缓冲文件 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>DeletePort &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;删除打印机端口 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>AddJob &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;启动一个打印作业 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>AdvancedDocumentProperties &nbsp; &nbsp;进行打印机高级设置 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>PrintDlg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;建立打印文本对话框 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>EnumPrintProcessors &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 枚举已安装的打印机处理器 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>EnumPrinterDrivers &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;枚举已安装的打印机驱动程序 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>EnumPorts &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 枚举可用打印机端口 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>EnumPrintProcessorDatatypes &nbsp; 枚举打印机所支持的数据类型 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>EnumForms &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 枚举所支持的打印机窗体 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>AbortDoc &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;终止一项打印作业 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;是 是 是<br>PrinterProperties &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 修改打印机属性 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>AddPrintProcessor &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 将打印处理器复制到打印机服务器中 &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>AddPrinterDriver &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;将打印机驱动程序复制到打印机服务器中 &nbsp; &nbsp;否 是 是<br>PrinterMessageBox &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 显示打印作业出错信息 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>ConnectToPrinterDlg &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 显示浏览对话并连接网络打印机 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>EndPagePrinter &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;结束打印页 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>EndDoc &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;结束打印作业 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;是 是 是<br>EndDocPrinter &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 结束打印作业 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>StartPage &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 准备打印机接收数据 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;是 是 是<br>WaitForPrinterChange &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;监测打印机或打印机服务器变化 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>GetPrintProcessorDirectory &nbsp; &nbsp;获取打印机驱动处理器路径 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>GetPrinterDriver &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;获取打印机驱动程序信息 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>GetPrinterDriverDirectory &nbsp; &nbsp; 获取打印机驱动程序路径 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>GetPrinter &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;获取打印机信息 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>GetPrinterData &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;获取打印机配置信息 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>GetForm &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 获取打印机窗口信息 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>EnumJobs &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;获取打印作业信息 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>GetJob &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;获取打印作业信息 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>OpenPrinter &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 获取指定打印机的句柄 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>ReadPrinter &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 读打印机数据 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>DocumentProperties &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;配置打印机设置 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;否 是 是<br>ConfigurePort &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br><br>
 
楼上已经回答差不多了。<br>(4)还可以这样,这是用的API<br>OnKeyDown<br>if key = VK_Return then<br>&nbsp; keybd_event( VK_TAB, MapVirtualKey( VK_TAB, 0 ), 0 , 0 );
 
补充弄影:<br>&nbsp; &nbsp; &nbsp; &nbsp; if Key=VK_RETURN &nbsp;then<br>&nbsp; &nbsp; &nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Perform(WM_NEXTDLGCTL, 0, 0);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Key:= 0;<br>&nbsp; &nbsp; &nbsp; &nbsp; end;<br>前提:form 的KeyPreview属性为true
 
感谢大家帮忙......<br>htw, [?]删除打印机是用DeletePrinterDriver 吗?但是如何通过打印机名获得该打印机<br>的句柄呢?gethandle行吗?能给点代码提示吗?<br><br><br>关于第3个问题,htw, 弄影、江南大米请注意:<br>问题可能没有说清除,具体是:<br>窗体中可能有EDIT和有MEMO控件,当焦点在EDIT时按ENTER后,就进入下一个焦点,<br>也是你们所回答的,但如在MEMO控件中的按ENTER就不跳转而是在本MEMO控件中输入<br>下一行的文字,而想使用CTRL+ENTER键进行跳转焦点。简单说就是在OnKeyDown中如何判断<br>CTRL+ENTER键。<br>
 
如何判断CTRL+ENTER键<br><br>procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;<br>&nbsp; Shift: TShiftState);<br>begin<br>if (ssctrl in shift) and (key=13) then<br>&nbsp; &nbsp;begin<br>&nbsp; &nbsp;...........<br>&nbsp; &nbsp;end;<br>end;<br>
 
1:formatdatetime('yyyy-mm-dd',你的日期)<br>
 
sword_liu你好!<br>你的方法不适合我,因为这样我代码量太大,会疯的。<br>
 
各位高手,第2、3两个问题依然没有解决,望帮忙将问题提前。<br>2如何通过打印机名字找到打印机,并将其删除?<br>3如何判断CHM文件之中,某一个页面是否存在?<br>
 
用Printer查找打印机.
 
To dadabox:<br>&nbsp; &nbsp;说得详细点好吗?
 
1、<br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br>&nbsp; DefLCID: LCID;<br>&nbsp; Buffer: array[0..255] of char;<br>begin<br>&nbsp; Application.UpdateFormatSettings := True;<br>&nbsp; StrPCopy(Buffer,'yyyy-MM-dd');<br>&nbsp; DefLCID := GetThreadLocale;<br>&nbsp; if SetLocaleInfo(DefLCID,LOCALE_SSHORTDATE,Buffer) then begin<br>&nbsp; &nbsp; ShortDateFormat := Buffer;<br>&nbsp; end;<br>&nbsp; Application.UpdateFormatSettings := False;<br>end;<br>
 
多谢大家!还有第二个问题没有解决,问题是:<br>如何通过打印机名字找到打印机,并将其删除?<br>
 
后退
顶部