954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Simulate Mouse Click

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.

IgniteTCS
Newbie Poster
6 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

Im unsure if theres an easier way to do this but you could do this pretty simple with an API call

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

Const MOUSEEVENTF_LEFTDOWN as Integer = 2
Const MOUSEEVENTF_LEFTUP as Integer = 4
Const MOUSEEVENTF_RIGHTDOWN as Integer = 8
Const MOUSEEVENTF_RIGHTUP as Integer = 16Public Shared Sub MouseClick()
{
    Dim x As Integer = 100
    Dim y As Integer = 100;
     mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0)
    mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0)
}


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

Gumster
Newbie Poster
6 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

thanks...

IgniteTCS
Newbie Poster
6 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

i cant run that to vb6 please help me ! code for simulate mouse click on vb6 only

banguwes22
Newbie Poster
1 post since Mar 2012
Reputation Points: 10
Solved Threads: 0
 

Please start your own thread if you have a problem

ChrisPadgham
Posting Pro in Training
413 posts since Sep 2009
Reputation Points: 102
Solved Threads: 78
 

Post: Markdown Syntax: Formatting Help
You