469,904 Members | 1,921 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,904 developers. It's quick & easy.

Mouse/Screen Image Status

Is it possible to determine if the image under a mouse changes in VB.net
code? For example if I position the mouse using the command;
Windows.Forms.Cursor.Position = New System.Drawing.Point(680, 595)

Is there code that would help me determine if the image under it has
changed?


Jun 19 '06 #1
9 1390
On Mon, 19 Jun 2006 18:00:11 -0700, "Daniel N"
<sa***********@yahoo.com> wrote:
Is it possible to determine if the image under a mouse changes in VB.net
code? For example if I position the mouse using the command;
Windows.Forms.Cursor.Position = New System.Drawing.Point(680, 595)

Is there code that would help me determine if the image under it has
changed?

Changed how?
A new image has replaced a previous image?
It's the same image, but has been modified?

Gene
Jun 20 '06 #2
Well, when I position the mouse in a certian area, eventually a new image
will replace what was there. I wanted to tell my program exactly when that
happened.

"gene kelley" <ok**@by.me> wrote in message
news:aq********************************@4ax.com...
On Mon, 19 Jun 2006 18:00:11 -0700, "Daniel N"
<sa***********@yahoo.com> wrote:
Is it possible to determine if the image under a mouse changes in VB.net
code? For example if I position the mouse using the command;
Windows.Forms.Cursor.Position = New System.Drawing.Point(680, 595)

Is there code that would help me determine if the image under it has
changed?

Changed how?
A new image has replaced a previous image?
It's the same image, but has been modified?

Gene

Jun 20 '06 #3
On Mon, 19 Jun 2006 21:38:47 -0700, "Daniel N"
<sa***********@yahoo.com> wrote:
Well, when I position the mouse in a certian area, eventually a new image
will replace what was there. I wanted to tell my program exactly when that
happened.

There's not enough app description given to provide a definitive
answer.

You might take a look at the PictureBox Invalidated event which fires
whenever an image is loaded. You might be able to adapt something
like this:
Private CursorInBox as Boolean
Private Sub PictureBox1_MouseEnter(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles PictureBox1.MouseEnter
CursorInBox = True
End Sub

Private Sub PictureBox1_MouseLeave(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles PictureBox1.MouseEnter
CursorInBox = False
End Sub

Private Sub PictureBox1_Invalidated(ByVal sender As Object, _
ByVal e As System.Windows.Forms.InvalidateEventArgs) Handles _
PictureBox1.Invalidated
If CursorInBox Then
MsgBox("Picture changed")
End If

End Sub

Gene

"gene kelley" <ok**@by.me> wrote in message
news:aq********************************@4ax.com.. .
On Mon, 19 Jun 2006 18:00:11 -0700, "Daniel N"
<sa***********@yahoo.com> wrote:
Is it possible to determine if the image under a mouse changes in VB.net
code? For example if I position the mouse using the command;
Windows.Forms.Cursor.Position = New System.Drawing.Point(680, 595)

Is there code that would help me determine if the image under it has
changed?

Changed how?
A new image has replaced a previous image?
It's the same image, but has been modified?

Gene


Jun 20 '06 #4
The image is outside my form, so I am unsure what to do next. Thank you for
the help.

"gene kelley" <ok**@by.me> wrote in message
news:eo********************************@4ax.com...
On Mon, 19 Jun 2006 21:38:47 -0700, "Daniel N"
<sa***********@yahoo.com> wrote:
Well, when I position the mouse in a certian area, eventually a new image
will replace what was there. I wanted to tell my program exactly when that
happened.


There's not enough app description given to provide a definitive
answer.

You might take a look at the PictureBox Invalidated event which fires
whenever an image is loaded. You might be able to adapt something
like this:
Private CursorInBox as Boolean
Private Sub PictureBox1_MouseEnter(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles PictureBox1.MouseEnter
CursorInBox = True
End Sub

Private Sub PictureBox1_MouseLeave(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles PictureBox1.MouseEnter
CursorInBox = False
End Sub

Private Sub PictureBox1_Invalidated(ByVal sender As Object, _
ByVal e As System.Windows.Forms.InvalidateEventArgs) Handles _
PictureBox1.Invalidated
If CursorInBox Then
MsgBox("Picture changed")
End If

End Sub

Gene

"gene kelley" <ok**@by.me> wrote in message
news:aq********************************@4ax.com. ..
On Mon, 19 Jun 2006 18:00:11 -0700, "Daniel N"
<sa***********@yahoo.com> wrote:

Is it possible to determine if the image under a mouse changes in VB.net
code? For example if I position the mouse using the command;
Windows.Forms.Cursor.Position = New System.Drawing.Point(680, 595)

Is there code that would help me determine if the image under it has
changed?

Changed how?
A new image has replaced a previous image?
It's the same image, but has been modified?

Gene


Jun 20 '06 #5

Daniel N wrote:
The image is outside my form, so I am unsure what to do next. Thank you for
the help.


Aha, so you are watching another application's window? This most likely
takes you out of the realm of what will be 'straightforward' to do in
VB.NET (or in .NET period) - it will involve API calls, I'm fairly
sure. You might try asking in general terms how to do this in one of
the win32 groups, although their answers will probably be in C++, so be
prepared for that...
Unless of course someone is about to dazzle us with a clean managed
solution?

--
Larry Lard
Replies to group please

Jun 20 '06 #6
On 20 Jun 2006 07:55:27 -0700, "Larry Lard" <la*******@hotmail.com>
wrote:

Daniel N wrote:
The image is outside my form, so I am unsure what to do next. Thank you for
the help.


Aha, so you are watching another application's window? This most likely
takes you out of the realm of what will be 'straightforward' to do in
VB.NET (or in .NET period) - it will involve API calls, I'm fairly
sure. You might try asking in general terms how to do this in one of
the win32 groups, although their answers will probably be in C++, so be
prepared for that...
Unless of course someone is about to dazzle us with a clean managed
solution?

Interesting how these added "by-the-way" statements can change
everything.

Gene
Jun 20 '06 #7
On Tue, 20 Jun 2006 09:37:28 -0700, "Daniel N"
<sa***********@yahoo.com> wrote:
The image is outside my form, so I am unsure what to do next. Thank you for
the help.


That statement creates a whole new ballgame. If you want to possibly
get some help, you need to describe in detail what the app is all
about. What is the source of the image you are monitoring? (A web
page or webcam app perhaps?). What is supoosed to happen when the
image does change?

Gene
Jun 20 '06 #8
Essentially, I am playing a game using in an application. I am trying to
make a program that would automate me playing. When a clock appears in a
certain portion of the App, it is my turn to make a decision. That clock
appearing is the only way to tell my program when to automate a decision. My
plan was to move the cursor above where the clock appears, then where it
does, have my program automate the decision.
Jun 20 '06 #9
On Tue, 20 Jun 2006 19:16:04 -0700, "Daniel N"
<sa***********@yahoo.com> wrote:
Essentially, I am playing a game using in an application. I am trying to
make a program that would automate me playing. When a clock appears in a
certain portion of the App, it is my turn to make a decision. That clock
appearing is the only way to tell my program when to automate a decision. My
plan was to move the cursor above where the clock appears, then where it
does, have my program automate the decision.


There is really no reliable way to do what you want to do. Outside of
your application, the cursor is a screen cursor or the cursor of
another application.

Good Luck,

Gene
Jun 21 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by masantha wee | last post: by
6 posts views Thread by Carlos García-Carazo | last post: by
4 posts views Thread by Henry Wu | last post: by
16 posts views Thread by Niels Jensen | last post: by
2 posts views Thread by quickcur | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.