Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Need Help With Mouse Position And How To Capture An Image

I am trying to write a program that takes a snapshot of a selected area then find the position of a part of the area then clicks on it


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Mouse Position Inside A Picture Box Or Image Control
I need help on retrieving the mouse position inside a picture box or image control. I can do it for the entire screen but I want to be able to do this in relation to the picture box. (Example: top left of picture box would be 0,0) If anyone can help me please post. I am using VB 5, but about to upgrade to 6 pretty soon. Thank you.

Capture Desktop Image And/or Wallpaper (not Screen Capture)
Hi all.
I have found several good codes for capturing the active screen. What I want to do is to capture the desktop, regardless of what programs are open or running, an image of the desktop as it looks with no other windows open, including the wallpaper if any.

Also, I am wondering where I can get the path to the picture being used as the wallpaper.

Any help?


Capture Top-Left Position
Hi all...

In Visual Basic 6 every point in the form has a top-left position that is shown in the standard toolbar. What I want to do is to write a program which captures the top-left position and store it in an array. For example if I have a map of UK when someone press the point where the London is, the values will be stored as cityLeft(0)=1200 cityTop=900.

Anyone can help me?


Capture And Return Position In A Window
I am writing a macro for Word that must go to the top of a document, edit some lines automatically and then return the view of the document back to exactly where I started. For example, before the macro runs, the top line in the display window is line 500 and the first character of that line is the 15th character of the line. The curser is positioned on the 5th line 27th byte from the start of line. After the macro runs I need everything back exactly as it was. The user SEES nothing different.

Thanks for any help. .

Capture Position In TextBox MouseDown

I would like to capture the position of my cursor in textBox when the MouseDown to insert caractère at the good place ! Like position 12 of 16 not the x,y position.



Capture A Control And Send The Image To A Clipboard Or Image File
there is any way to capture a control and send the image of that control to a clipboard or image file?
thanks a lot for your help

Image Capture && Then Draw Line In Coordinates On Captured Image In Vb
I know how to store the image in database but i want to know how to for example :

First Capture an image then allow the user to draw a line as in GRAPH x co ordinate & Y co ordinate on the image
and store this image in the database

Pls help me.


How To Find Relative Position Of Inner-image Within Outer-image

I have an assignment, here are the details.

Platform : Excel/VB Macro

Task : 1st. Put a Map of location, e.g. road-map, take 2nd image of vehicle and put it on road, vehicle should not go out of road.

anybody have idea how to do it.

i am new to graphics programming.


Mouse Capture
ITtoolbox Portal for Visual Basic -

Hi VB-people,

I'm trying to erase the content( made with API finction like LineTo etc) of
a window wich has "hwnd" property but I want to do it with API function like
SendMessage to a HWND but it didn't work. Could somebody more experencied in
API to help my
Nica Constantin

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~

API Mouse Pos Capture
I am using releasecapture with a form that has no titlebar and I have added another option that I would like to perfect... docking. Currently my program checks if the left and top of the window are outside of the screen and if so it puts them in the screen but this looks bad. What I want to do it capture the mouse x and y so that when the user trys to take the window outside the screen's bounds the program stops them, stops the mouse movement. Thanks.

Capture Screen AND MOUSE
There are many posted examples of how to programatically take a screenshot
and display/print/save the image.

None that I have come across capture the the image of the mouse pointer.

Does anyone know how to do this?

Mouse Capture Button
How can know when i clickt my left mouse button in windows?

not inside the program itsellf

Capture Mouse - DIFFICULT
I have created an activeX control which uses picture boxes with labels inside them. I use SetCapture and ReleaseCapture to handle rollover images for the pictureboxes. All works fine there...Picture_Click also works fine, BUT if the user clicks on the LABEL thats inside the picturebox, the Picture_Click does not fire, rather the Label_mouseMOVE event fires...not the label click...this would be okay to workaround if i called the Picture_Click event from here but SOMETIMES the label was just hovered over and NOT really clicked (inconsistent), I tried adding a call to GetAsyncKeyState to check for the L mouse button, but that does not work either...Any ideas? I just want clicking the label to behave the same way that clicking the picture does (all controls are arrays as well which makes it that much more difficult) ANY help would be greatly appreciated!!

Capture The Mouse In A Form
Can anybody tell me how to capture the mouse in a form so that it can not go out of it. I mean, I want the mouse to be capable of moving within the form.
I know it can be done this, because I've already seen it. The problem is that I can't remember how, and can't find it either.

Is There A API To Capture Mouse Movement ?
What I want is the trigger an event whenever the user move or click with the mouse no matter where the pointer is something like to halt the screensaver back to desktop.


How Do I Capture The Mouse Cursor?
Can anyone tell me how to capture an image of the mouse cursor to place in a picturebox or save as a file?

If you know how please reply to this message.


Playing With The Mouse Capture
Another hard one I'm afraid.

I'm trying to move a control by dragging it with the mouse, for various long complicated reasons it's a window I created with the API I cant use VB's dragging methods and I don't want to change the HitTest results. So I'm subclassing the mousedown message, reverting the capture to an offscreen API created window and making my window invisible, I'm then subclassing the mouseup message on my offscreen window to detect where the user drops the window, the trouble is I also want to detect the double click message on my onscreen window which isn't firing because I'm switching the capture around.

Any Clues?

Mouse Position

I got a question about the mouse position...
I have one big partition which is build up with some small partitions. Now I want everytime I mouse over one of those small partitions that partition will change color. But I don't get the DirectInput working very good.. and to turn the x and y from the screen (given by Form_MouseOver) into the right x, y and z of the 3d world..

I use DirectX 7 and Visual Basic 6 but I thought I read somewhere that DirectX 8 has some kind of build in function for that. So if that true and if someone can get me that I could also change to use DirectX 8.

I hope someone can help me.

Sorry for my bad english but I'm not from an english speaking country but from the Netherlands


How To Get Mouse Position
I want to know how to get the mouse position. If possible the less complicated way to do it.

Getting Mouse Position (x,y)??
i was wondering how you would go about getting the current mouse position (x and y.) would you use an api call or what? thanks

Mouse Position
I have an error dialog within a program which contains both a YES and NO command button. I would like to position the mouse on the NO button by default whenever the dialog is made visible. Any suggestions?

Thanks in advance.

Mouse Position
I am having issues with determining if the mouse is over a certain control (Frame, and also Labels). I spent some time looking through previous posts here, and I was able to piece together some code that does work, except for one drawback. I am able to determine if the cursor is over the frame, but I need to double click to trigger a click event on any of the controls inside the frame (or even to be able to enter text in a textbox, etc.). In the case of the label, I need to click like a hundred times to get the click event to fire.

I guess I am looking either for a better way to do this, or for a way to eliviate my issue with what I believe is the focus getting shifted back to the control I am clicking on (as the Form itself actually has the cursor at that point).

With this code I am just making the frame "Pop Up" or increase in size when the mouse is over it, so that the user can have more room and see more controls. This part is in the form...

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

If fraMileage.Visible = True Then
If MouseOver(X, Y, fraMileage) = True Then
fraMileage.Top = 5695
fraMileage.Height = 1925
If fraMileage.Top = 5695 Then
fraMileage.Top = 6750
fraMileage.Height = 870
End If
End If
End If
End Sub

Private Sub fraMileage_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
' When the mouse is dragged across the control, set the capture.
If GetCapture <> Me.hwnd Then
SetCapture Me.hwnd
End If
End Sub
... and this part is in a module.

Option Explicit

Public Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function GetCapture Lib "user32" () As Long
Public Declare Function ReleaseCapture Lib "user32" () As Long

Public Function MouseOver(X As Single, Y As Single, objCtrl As Control) As Boolean

If (X > objCtrl.Left) And (X < (objCtrl.Left + objCtrl.Width)) And _
(Y > objCtrl.Top) And (Y < (objCtrl.Top + objCtrl.Height)) Then

MouseOver = True
MouseOver = False
End If
End Function
Thanks in advance for any help that anyone can give me.

Mouse Position
I'd like to find the mouse position on the form and if it is within a picturebox, I'd move a line.
Well, I need help with finding the mouse position.

I'd appreciate your help.


"Great Ideas need Landing Gears as well as Wings"

Mouse Position
How can I make my mouse appear in the center of the screen at run time?

Mouse Position
How do I get the mouse position into a label?

Mouse Position
Hello all I'm trying to make a program where the user can press the down key on a picture and the picture zooms up at that point. My question is how do I know exactly where the mouse is? Is there some easy way to detect the mouse's coordinates, I was hoping that vb might have a built in way to do this like mouse.Left or something but I have a feeling that is wishful thinking.


Get Mouse Position In Vb ..?
how to get mouse position in active window with window's handle

How Do You Get The Mouse Position Using Vb?
I want my program to display x co ordinate and y co ordinate to where my mouse position is on the screen, is this possible?

Mouse Position
How do i check whether the mouse is still inside a given form?

I have tried mousemove event maths using etc etc but that doesn't work for me.

Thanks in advance

Mouse Position
How cani i control the position of mouse cursor. suppose i want taht my mouse should
be on the textbox in a form by finding the x and y pos of textbox.

Mouse Position
if there a way i could make my program give a msgbox stating the position of the click, when i click on anywhere on the form?

Mouse Position Help
Okay, I did a search and found nothing useful, so im going to ask

Basicly, I need to get the current mouse position, move it over a control, get the position again and call a function.

Why I am doing this:
I have a custom messaegbox (bubble box) that appears when an error happens. When an error occurs, I want the mouse to move to the control that has the error and then call the messagebox to display the message.

Also, is it possible to change which current active tab is selected?

Mouse Position
This is probably really simple but I can't find anything on it. I just want to move the mouse cursor to a set point on the form. Thanks.

Mouse Position
Is it possible in visual basic to force a mouse cursor to move to a specific location on a page on an event? i.e. Top Left or X,Y Coordinates?

Mouse Position
I have an error dialog within a program, and want to position the mouse over a command button when the dialog becomes visible. Any suggestions would be greatly appreciated!

Need Help In Mouse Position......
i want to send the mouse position one client PictureBox to another client PictureBox.(suppose i move the mouse its movements reflect to another client picturebox)how can i do it........anybody know about it tell to me..

with regards.

Mouse Position
Should be a simple question but does anybody know how to find the x and y coordinates of the mouse (in terms of the screen) at any given time?

I just can't work it out for the life of me and a moments assistance from anybody to point me in the right direction would be much appreciated.


Mouse Position
again.. i got 2 forms hehe

when right clicking one
second one appears
how do i make it so that when second one apears
it will appear at the place where mouse was clicked?
(in other words, how do i capture mouse positions..)

Mouse Position
How do i get the position of the mouse??

i wanna make a second cursor thing follow it round according to its position

frivolous i know but any help would be appreciated

Mouse Position
How do i get the position of the mouse??

i wanna make a second cursor thing follow it round according to its position

frivolous i know but any help would be appreciated

Mouse Position?
I want one end of a line to follow the mouse?

Mouse Position
How do i check whether the mouse is still inside a given form?

I have tried mousemove event maths using etc etc but that doesn't work for me.

Thanks in advance

Mouse Position

Is there any way to know the instance when the mouse is brought on to the border of the form.

My problem is in my application when the form is resized using controlbaox and move the mouse over the border of the form then I am not getting the double arrow mouse pointer.

Thanks in advance.


Mouse Position
PLease help!!!
Does anyone khow to get the mouse position (X,Y)?

Thanks in ADv


Capture A Mouse Click Event
I have a login form with two fields, UserID and Password (duh !!)
It also has two controls, OK and CANCEL.

I also have a routine in the code that calls a message box routine if the UserID loses focus that activates if there is no UserID is entered (UserID="").

Is there a way to capture the mouse click on the CANCEL control that will set a flag or some other way bypass the LostFocus routine?

Thank you,


Capture Mouse Event On Combo Box.

Does anyone know how to capture mouse events on combo boxes. I would like to know when the left mouse button is clicked on an item in the list.


Capture Mouse Wheel (anytime, Anywhere)
i can make my program detect mouse wheel action, but only if my program is the active one
i need it to detect this always and anywhere, even if my program is not currently active

could anybody help me on this one?
(btw, i'm coding in vb 6.0)


Capture Mouse Cursor Coordinates
Hello. I am trying to write a small app that captures the mous coordinates on the screen. I found the how to on MSDN here but it gives me a error runtime error 53 error.

I basically copies and pasted the code into my new project. Is there a reference I need to add or something. Can anyone else get it to work?

Capture Desktop Without Mouse Flashing?
Is there any method to capture the desktop without the mouse flashing each time?

Copyright © 2005-08, All rights reserved