Simulate Mouse Click

Reply

Join Date: Mar 2007
Posts: 6
Reputation: IgniteTCS is an unknown quantity at this point 
Solved Threads: 0
IgniteTCS IgniteTCS is offline Offline
Newbie Poster

Simulate Mouse Click

 
0
  #1
Mar 21st, 2007
I am working on a project where I need to open a .pps file using Visual Basic 6 (which I have done already). I need to change the slide transition according to input obtained from a serial port that will keep changing during the execution of the VB project. Please assist me on this.

As the mouse click will proceed to the next slide in the slideshow, I would like to know if there is a way to simulate this mouse click and hence indirectly alter the slide transition timing. Please help me.
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 6
Reputation: Gumster is an unknown quantity at this point 
Solved Threads: 0
Gumster Gumster is offline Offline
Newbie Poster

Re: Simulate Mouse Click

 
0
  #2
Mar 21st, 2007
Im unsure if theres an easier way to do this but you could do this pretty simple with an API call

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Declare Auto Function mouse_event Lib "user32.dll" (ByVal dwflags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal dwData As Integer, ByVal dwExtraInfo As Integer) As Integer
  2.  
  3. Const MOUSEEVENTF_LEFTDOWN as Integer = 2
  4. Const MOUSEEVENTF_LEFTUP as Integer = 4
  5. Const MOUSEEVENTF_RIGHTDOWN as Integer = 8
  6. Const MOUSEEVENTF_RIGHTUP as Integer = 16Public Shared Sub MouseClick()
  7. {
  8. Dim x As Integer = 100
  9. Dim y As Integer = 100;
  10. mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0)
  11. mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0)
  12. }

simply changing the values of x and y will simulate a click.

Hope this helps if you want more help with how the API works run a google search on it
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 6
Reputation: IgniteTCS is an unknown quantity at this point 
Solved Threads: 0
IgniteTCS IgniteTCS is offline Offline
Newbie Poster

Re: Simulate Mouse Click

 
0
  #3
Mar 22nd, 2007
thanks...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC