Mouse Control

D

Dean C

I want to simplify the process of filtering for downstream tasks. In the
Network Diagram view, if you press and hold shift, then left mouse click on a
TaskBox, all downstream tasks are selected.

The code below, with appropriate values in the variables, will get me where
to position the cursor, but I can't figure out how to position the cursor so
that I can use Sendkeys or vbKeyShift vbKeyLButton. Any tips will be
appreciated.

BoxSet Action:=pjBoxSelect, TaskID:=SubjectTask,
ProjectName:=SubjectProjectName
MyXPosition = BoxGetXPosition(TaskID:=SubjectTask,
ProjectName:=SubjectProject)
MyYPosition = BoxGetYPosition(TaskID:=SubjectTask,
ProjectName:=SubjectProject)
 
S

Scudder

Take a look at the SetCursorPos function call in the Windows user32 DLL.

You'll need to declare both a PointAPI type & the DLL function in your code.
 
D

Dean C

Thanks, but you lost me. I tried using POINTAPI, but got runtime error 49,
Bad dll calling convention. I got the mouse moved using the code below, but I
can't get sendkeys to send vbKeyLButton.
Declare Sub SetCursorPos Lib "user32" (ByVal MyXPosition As Long, ByVal
MyYPosition As Long)
SetCursorPos(MyXPosition, MyYPosition)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top