473,381 Members | 1,555 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,381 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 1507
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.