get coordinates of current highlighted or active object

D

Doug

Hi

I am trying to find a way to make the mouse cursor move to the keyboard
cursor position in an application. For example, I use an application called
Enterprise Guide, and I control this application using Dragon naturally
speaking as I have a disability that makes using the keyboard quite
difficult.

I often have to say the name of an object to make to be the active or
highlighted object. However to do something such as drag and drop in Dragon
NaturallySpeaking , I need to have the mouse at the same position that I
want to drag from.

I know there are functions such as GetCursorPos - but this appears only to
work in terms of the mouse position. What I would like to do is to find the
coordinates of the current active highlighted object. An example of this
could be, in windows explorer, if your mouse position is on the right-hand
side of your screen, but you have a folder highlighted in the left pane. How
could you move the mouse cursor to the location where the highlighted object
is?

I would appreciate any suggestions, or any links to any sites that may
assist me. I am able to write code but I can't find a way to make this
work.

Thank you for your help

Doug
 
P

Peter Duniho

[...]
I know there are functions such as GetCursorPos - but this appears only
to
work in terms of the mouse position. What I would like to do is to find
the
coordinates of the current active highlighted object. An example of this
could be, in windows explorer, if your mouse position is on the
right-hand
side of your screen, but you have a folder highlighted in the left pane.
How
could you move the mouse cursor to the location where the highlighted
object
is?

I would appreciate any suggestions, or any links to any sites that may
assist me. I am able to write code but I can't find a way to make this
work.

It will depend entirely on what is displaying the object in question.

For many things, there will be a window instance associated with the item
(controls are windows too), and you can get the coordinates for the
window. But for many other things, there is no specific window
association with the item, because the item you're looking at is contained
inside a control that does all of its own drawing and user-interface work
without the benefit of sub-controls.

So, you could address this in specific situations, but not in a general
way. IMHO, it would probably be better to work on a way to make it easier
to move the mouse cursor around manually. I'm kind of surprised,
actually, that a speech-input program like Dragon's doesn't already
include a feature like that.

Pete
 
D

Doug

Hi Peter,

Dragon does have the feature but I am trying to help both myself and other
people with a disability to work more effectively.

The way that Dragon performs this task is to use a command such as
"MouseGrid 4 2 2 1 Button Click". Dragon divides the screen using MouseGrid
into a 3X3 matrix and drills down using the matrix in a matrix concept until
the mouse is pinpointed. This is clunky but it maybe the only way to do
this.

Thanks very much for your response.

Doug
Peter Duniho said:
[...]
I know there are functions such as GetCursorPos - but this appears only
to
work in terms of the mouse position. What I would like to do is to find
the
coordinates of the current active highlighted object. An example of this
could be, in windows explorer, if your mouse position is on the
right-hand
side of your screen, but you have a folder highlighted in the left pane.
How
could you move the mouse cursor to the location where the highlighted
object
is?

I would appreciate any suggestions, or any links to any sites that may
assist me. I am able to write code but I can't find a way to make this
work.

It will depend entirely on what is displaying the object in question.

For many things, there will be a window instance associated with the item
(controls are windows too), and you can get the coordinates for the
window. But for many other things, there is no specific window
association with the item, because the item you're looking at is contained
inside a control that does all of its own drawing and user-interface work
without the benefit of sub-controls.

So, you could address this in specific situations, but not in a general
way. IMHO, it would probably be better to work on a way to make it easier
to move the mouse cursor around manually. I'm kind of surprised,
actually, that a speech-input program like Dragon's doesn't already
include a feature like that.

Pete
 
B

Bob Powell [MVP]

I see that the Microsoft speech recognition system also has a mousegrid that
enables you to specify coordinates in the way you say Dragon does. This is a
feature of Vista. Here is the URL of an article that details using it to do
something like what you need.
http://www.microsoft.com/betaexperience/nlarchive/bexp2/issue_8/LookNoHands.aspx


Do you have a Vista system?

I don't have much experience with accessibility systems or the speech
recognition tool that comes with Vista but you may also be able to pose this
question in one of the Vista groups where you may get some more concrete
information.

--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


Doug said:
Hi Peter,

Dragon does have the feature but I am trying to help both myself and other
people with a disability to work more effectively.

The way that Dragon performs this task is to use a command such as
"MouseGrid 4 2 2 1 Button Click". Dragon divides the screen using
MouseGrid into a 3X3 matrix and drills down using the matrix in a matrix
concept until the mouse is pinpointed. This is clunky but it maybe the
only way to do this.

Thanks very much for your response.

Doug
Peter Duniho said:
[...]
I know there are functions such as GetCursorPos - but this appears only
to
work in terms of the mouse position. What I would like to do is to find
the
coordinates of the current active highlighted object. An example of this
could be, in windows explorer, if your mouse position is on the
right-hand
side of your screen, but you have a folder highlighted in the left pane.
How
could you move the mouse cursor to the location where the highlighted
object
is?

I would appreciate any suggestions, or any links to any sites that may
assist me. I am able to write code but I can't find a way to make this
work.

It will depend entirely on what is displaying the object in question.

For many things, there will be a window instance associated with the item
(controls are windows too), and you can get the coordinates for the
window. But for many other things, there is no specific window
association with the item, because the item you're looking at is
contained inside a control that does all of its own drawing and
user-interface work without the benefit of sub-controls.

So, you could address this in specific situations, but not in a general
way. IMHO, it would probably be better to work on a way to make it
easier to move the mouse cursor around manually. I'm kind of surprised,
actually, that a speech-input program like Dragon's doesn't already
include a feature like that.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top