473,396 Members | 1,774 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,396 software developers and data experts.

Mouse coordinates to record click events

759 512MB
Hi all !
Can you help me ? I use VB6. Thank you !

I have some code to indicate the mouse position when I move it over my screen (not only over a form or a control).
Now I wish to intercept the CLICK event. In fact I wish to "teach" my program where to make automatic clicks. Something like recording a macro in Excel: When I make a click my program must "feel" that and create a list with coordinates.

I know all I need for that except how to intercept the click event. I repeat: a click somewhere on my screen, even in an empty area.

I know that my English is not strong. Hope you understand my need.

Thank you for your patience.
Oct 2 '11 #1
1 3072
Mihail
759 512MB
Evrika !
Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  3. ' Copyright ©2003-2010 Vivek Nigam, All Rights Reserved.
  4. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  5. ' Purpose : See if the left or right  mouse button is clicked or relised outside and inside the program
  6. ' You are free to use this code within your own applications only,
  7. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  8. Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
  9. Const Cap1 = "Capture Mouse Events"
  10.  
  11. Private Sub Form_Load()
  12.     frmCaptureMouseEvents.Caption = Cap1
  13. End Sub
  14.  
  15. Private Sub Timer1_Timer()
  16.     '// To check left mouse button pass 1,
  17.     If GetAsyncKeyState(1) = 0 Then
  18.         Label1.Caption = "Your Left Mouse Button Is UP"
  19.     Else
  20.         Label1.Caption = "Your Left Mouse Button Is Down"
  21.     End If
  22.  
  23.     '// To check right mouse button pass 2,
  24.  
  25. '    If GetAsyncKeyState(2) = 0 Then
  26. '        Label1.Caption = "Your Right Mouse Button Is UP"
  27. '    Else
  28. '        Label1.Caption = "Your Right Mouse Button Is Down"
  29. '    End If
  30. '
  31. End Sub
Oct 11 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: cte | last post by:
I have a swing program involving drag and drop - implemented with javax.swing.TransferHandler etc. My problem is that I want to determine the mouse coordinates of a drop onto one of my...
3
by: | last post by:
How can I get the mouse coordinates in Mozilla? I try x = event.pageX but it does not work... basically I try alert(event) and it does not work. Where is the problem? the full code...
4
by: Jonne | last post by:
Hi, I haven't found anything like this anywhere with Google, so I'm posting it here, hoping one of you people knows how to do something like this. I'm trying to get the mouse coordinates in a div,...
2
by: Robin Senior | last post by:
Hi, I'm trying to drag and drop onto a Panel on my form. The panel is inside a groupBox, which of course is inside my form. When dropping the item onto my Panel, I want it to appear at that...
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. ...
0
by: Henry C. Wu | last post by:
Hi, I have a form that has a video "inserted" at the form's Handle. Like so: '//Create Capture Window capGetDriverDescriptionA(0, lpszName, 100, lpszVer, 100) '// Retrieves driver info lwndC =...
1
by: finerrecliner | last post by:
trying to get the mouse coordinates to show up in an alert box. but all i get is "undefined" the script should work like: click the button, then click anywhere on the page to show your current x...
4
by: Luongo | last post by:
Hi, I'm working on a project in which I'd like to have the user's mouse click coordinates included in a php URL which would load onClick, for example http://...imagecreate.php?x=200&y=100. I've...
4
by: atn2002 | last post by:
How can I track the mouse coordinates outside the active window? No one can tell me its not possible because Google Spreadsheets and EditGrid both do it. When you drag down to select cells these...
4
by: mbatestblrock | last post by:
I hope this makes some sense. My ultimate goal here is to execute a block of code if the mouse has not moved in a minute or so within the broswer. The machine I am running this on is for internal...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.