如何得到 MS WORD里插入符号的位置?下面的这段代码能获得其他程序中插入符的位置,但在MS word中不行unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls;type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure myWM_ACTIVATE(var Message: TMessage); message WM_ACTIVATE;
    procedure Button1Click(Sender: TObject);//截获消息
  private
    { Private declarations }
  public
    { Public declarations }
     HActWin,Hself: HWND;
  end;var
  Form1: TForm1;implementation{$R *.dfm}procedure TForm1.myWM_ACTIVATE(var Message: TMessage);
begin
  if Message.wParam = WA_CLICKACTIVE  then
  begin
    //SetActiveWindow(message.lParam);
    if (HActWin<>message.lParam) and (message.lParam<>Hself) then
      HActWin:=message.lParam;
  end;
end;procedure TForm1.Button1Click(Sender: TObject);
var
  focushld,windowhld:hwnd;
  threadld:dword;
  P1:TPoint;
begin  SetActiveWindow(HActWin);
  windowhld:=GetForegroundWindow;
  threadld:=GetWindowThreadProcessId(Windowhld,nil); //Windowhld
  AttachThreadInput(GetCurrentThreadId,threadld,true);
  GetCaretPos(P1);
  Caption:=IntToStr(P1.X )+'::'+IntToStr(P1.y ) ;
  Focushld:=getfocus;
  AttachThreadInput(GetCurrentThreadId,threadld,false); if focushld = 0 then Exit;
end;end.