Solved

get type cyrsor position at screen from microsoft word and any enviroment for type text

Posted on 2006-07-05
1
212 Views
Last Modified: 2010-04-05
hi
i want to show a form when user type anything in microsoft word or any word proccesor enviroment sych as MS Notepad or . and need to get type cursor position at screen for displaying my form from this position. please help me for get type cursor position at screen.
and so sorry for my bad english ;-)
best regards.
0
Comment
Question by:mahdiparak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 10

Accepted Solution

by:
atul_parmar earned 500 total points
ID: 17043282
Hi, try this

var
  p : TPoint;
  hWord, Pid1, Pid2 : THandle;
  WordTitle : String;
begin
  WordTitle := 'Document1 - Microsoft Word';
  hWord := FindWindow(nil, PChar(WordTitle));
  if (hWord = 0) or (hWord <>  GetForegroundWindow) then Exit;
  Pid1 := GetWindowThreadProcessId(hWord, nil);
  Pid2 := GetCurrentThreadId;
  AttachThreadInput(Pid1, Pid2, True);
  if GetCaretPos(p) then
    if Windows.ClientToScreen(hWord, p) then
      MoveWindow(Handle, p.X, p.Y, Width, Height, True);
end;
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month5 days, 23 hours left to enroll

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question