472,378 Members | 1,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,378 software developers and data experts.

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 1462
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Wonko | last post by:
Here's my problem if anyone could be so kind to help me out. I assume it's quite easy for an experienced programmer but I'm not one of them :) I have a JavaScript code that: - displays multiple...
4
by: masantha wee | last post by:
Hi all, I am using Firefox and embedding Javascript in html. I understand that we can use mouse events by coding them in the body of html (by creating a button or anything and by adding in the...
6
by: Carlos García-Carazo | last post by:
Hello, I am working on a C# application for an industrial machine, using Windows Forms, where the user could look at the screen from a 90 degree rotated position, like he could turn the monitor...
4
by: Henry Wu | last post by:
Hi, I see examples of Magnifying an area under mouse coordinates to a form or picturebox using VB6 and VC6, does anyone know how to do it under VB.NET? Its nice to use the new GDI+ for it. ...
16
by: Niels Jensen | last post by:
I have been developing a little project which draw's a hexgrid on a panel within a form similar to this - it:s used as a client from a e-mail based strategy game: ____ ____ / \...
3
by: Tom | last post by:
I have a picturebox on my VB.NET form. The picturebox size mode is set to stretched. I then load an image into that form and display it. As the user moves the mouse over the form, I want to get and...
2
by: quickcur | last post by:
Hi, I have html like this: <div id="myCanvas" style="border:10px, black;position:relative;height:250px;width:100%;"> <img id="p" src="p.jpg"> </div> When user click the mosue, I would like ...
1
by: vsvnmurthy | last post by:
Hai , When i am trying to load an image using javascript popup window(same dimensions of image), the status bar and Mouse pointer showing continuous loading even though image loaded. How can i...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.