在VB中可以使用API实现,不知道在Delphi中行不行?
解决方案 »
- dbexpress+mysql这样组合好不好用
- 取最近日期价格连接两表!
- 想要 一个和QQ一样功能的控件,有没有什么好推荐啊?高分
- bewill(海咪咪),近来界分
- 为什么出现undelared identifier :TQRExcelFilter
- delphi多线程的问题,希望得到帮助,很急~~谢谢
- 请问怎么让一个窗体最小化时藏在任务栏里,不再底下显示?
- 如何叫 del7 的edit 支持多行显示
- 写一个升序程序,可随意输入任何数据,按"排序"按纽后可显示排序结果
- 30分求知:regedit是怎样控制用户使用的程序??即不允许用户使用!!
- 怎样去使用DELPHI
- DELPHI的自动完成功能这么慢吗?
我应该没记错吧
HideCaret(HWND hwnd)
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;type
TForm1 = class(TForm)
Edit1: TEdit;
procedure FormCreate(Sender: TObject);
private
Old:TwndMethod;
procedure NewMethod(Var Message:TMessage);
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);
begin
Old:=Edit1.WindowProc;
Edit1.WindowProc:=NewMethod;
end;procedure TForm1.NewMethod(var Message: TMessage);
begin
if Message.Msg<>WM_SETCURSOR then
Old(Message);
{如果既不要输入光标,也不要焦点则可以这样}
if (Message.Msg<>WM_SETCURSOR) and (Message.Msg<>WM_SETFOCUS) then
Old(Message);
end;end.
hWnd为edit控件的窗口句柄,成功时返回非0值。
注意此函数仅当hWnd拥有插入符时才有效,且当调用n次此函数后,需调用n次ShowCaret(HWND hWnd)才能使插入符再显示出来。
当hWnd为NULL时,隐藏当前任务中拥有插入符的窗口中的插入符。