掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
キャレットを持っているコンポーネントのハンドルを取得するには? (ID:16541)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
キャレットってフォーカスと考えていいのであれば procedure TForm1.Timer1Timer(Sender: TObject); var ThisWH: HWND; wc: TWinControl; buf: array[0..1000] of char; begin Timer1.Enabled := false; wd := GetFocusInAnotherProcess; selfID := GetCurrentThreadID; wh := GetForegroundWindow; otherID := GetWindowThreadProcessID(wh, @prcID); if AttachThreadInput(otherID, selfID, True) then begin SetForegroundWindow(wh); ThisWH := GetFocus; AttachThreadInput(otherID, selfID, False); SendMessage(wd, WM_GETTEXT, 1000, Integer(@buf[0])); Edit1.Text := string(buf); end else Edit1.Text := ''; Timer1.Enabled := true; end; WM_GETTEXTに応答してくれないとテキストは拾えないですが...
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.