SendKeys Mouse Click? (1 Viewer)

Adrianna

Registered User.
Local time
Today, 12:57
Joined
Oct 16, 2000
Messages
254
Okay....I'm frustrated with NetViz....what a terrible program. Anyway, I'm try to send a Dbl Click or a right mouse click to the program from access. I can nagivate all the way up to the page that I want to see, but then I can't open it because the program only allows initiation by double left click, or single right click and the selection of 'Show'. So, I don't really care which way I go, but I'm able to do everything else that I need to do up to that point and then....boom....I slammed into this brick wall.

Any ideas for sending a mouse click to another application from Access?
 

charityg

Registered User.
Local time
Today, 17:57
Joined
Apr 17, 2001
Messages
634
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, _
ByVal cButtons As Long, ByVal dwExtraInfo As Long)

Private Declare Function GetMessageExtraInfo Lib "user32" () As Long

Const MOUSEEVENTF_LEFTDOWN = &H2
Const MOUSEEVENTF_LEFTUP = &H4
Const MOUSEEVENTF_MIDDLEDOWN = &H20
Const MOUSEEVENTF_MIDDLEUP = &H40
Const MOUSEEVENTF_MOVE = &H1
Const MOUSEEVENTF_ABSOLUTE = &H8000
Const MOUSEEVENTF_RIGHTDOWN = &H8
Const MOUSEEVENTF_RIGHTUP = &H10



Sub MouseClick


'click the right button
mouse_event MOUSEEVENTF_RIGHTDOWN Or MOUSEEVENTF_RIGHTUP, 0, 0, 0, GetMessageExtraInfo()

mouse_event MOUSEEVENTF_RIGHTUP, 0, 0, 0, GetMessageExtraInfo()

End Sub
 

Adrianna

Registered User.
Local time
Today, 12:57
Joined
Oct 16, 2000
Messages
254
:confused: How do I get this to send a double mouse click into another application?

I declared the Private Function at the beginning and then in my OnClick() I have this:

Dim stFileName As String
Dim WshShell As Object
Dim oApp As Object


Shell "C:\netViz\Pro50\Program\NETVIZPR.EXE ", vbMaximizedFocus
Set WshShell = CreateObject("WScript.Shell")
WshShell.AppActivate "NetViz"

SendKeys "{ENTER}", True
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, GetMessageExtraInfo()
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, GetMessageExtraInfo()
mouse_event MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, GetMessageExtraInfo()
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, GetMessageExtraInfo()

This doesn't do anything...I'm thinking that if the mouse click is happenning...it's taking place in Access.
 

Users who are viewing this thread

Top Bottom