SmartCode Web Forum
Back
Login
Register
Login
Register
Home
»
SmartCode ViewerX VNC Viewer ActiveX
»
General Discussion
»
Sending "mouse down" event with SendMousePointerEvent
Sending "mouse down" event with SendMousePointerEvent
Post Reply
Like
64
Sending "mouse down" event with SendMousePointerEvent
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
mseldin
mseldin
posted 16 Years Ago
ANSWER
Topic Details
Share Topic
Group: Forum Members
Posts: 3,
Visits: 11
Hello,
Is there any way of sending "Mouse Down" event with no mouse up and vise a versa?
I need it for making drag action on the client side (e.g dragging items or windows programmaticly).
Tags
Api
Mouse
Reply
Like
64
Yury Averkiev (s-code)
Yury Averkiev (s-code)
posted 16 Years Ago
ANSWER
Post Details
Share Post
Group: Administrators
Posts: 1.9K,
Visits: 3.6K
Please use SendMousePointerEvent function for that. The buttonMask argument allows to emulate mouse presses.
enum MouseButtonFlags
{
Left = 1,
Right = 4
}
Regards,
Yury Averkiev,
SmartCode
Reply
Like
69
mseldin
mseldin
posted 16 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 3,
Visits: 11
This solution doesn't work,
If i want to drag my window from point x,y to point x1,y1,
from what i understood , i will need to write the following code:
enum MouseButtonFlags
{
Left = 1,
Right = 4
}
void MoveWindow(int x1,int y1, int x2,int y2)
{
//Command mouse to move to coordinates x1,y1 (the upper bar of the screen i want to drag)
viewerX.SendMousePointerEvent(x1,y1, 0);
//Press left mouse button
viewerX.SendMousePointerEvent(x1, y1, Left);
//Drag the window to x2,y2 (by moving the mouse to these coordinates)
viewerX.SendMousePointerEvent(x2, y2, 0);
//lift up the left mouse button ?
}
Reply
Like
41
Yury Averkiev (s-code)
Yury Averkiev (s-code)
posted 16 Years Ago
ANSWER
Post Details
Share Post
Group: Administrators
Posts: 1.9K,
Visits: 3.6K
To be honest I've no idea what would need to be sent to emulate drag and drop. But I think I know a way to figure it out.
Download and compile a VNC server source code.
Locate the part of the code that receives rfbPointerEvent event from a client
Add code to the server that would log rfbPointerEvent messages. You can do simple OutputDebugString to a debug console.
With this information you should have pretty clear idea what messages a server expects to receive for the drag and drop to work.
Regards,
Yury Averkiev,
SmartCode
Reply
Like
44
mseldin
mseldin
posted 16 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 3,
Visits: 11
As i understand it - it won't help.
Could you tell me if the api function - SendMousePointerEvent has any wrapping inside of your activeX?
It seems that your function "SendMousePointerEvent" sends "Mouse Button Up" event every time it is called, so it is physicly impossible to make drag event with the activeX api.
Could you confirm this theory?
Thank you.
Tags
Api
Reply
Like
44
Yury Averkiev (s-code)
Yury Averkiev (s-code)
posted 16 Years Ago
ANSWER
Post Details
Share Post
Group: Administrators
Posts: 1.9K,
Visits: 3.6K
Look at the output produced by the custom build of the ActiveX that I sent to you. Have you tried to feed the same intput parameters to the SendMousePointerEvent?
It seems that your function "SendMousePointerEvent" sends "Mouse Button Up" event every time it is called, so it is physicly impossible to make drag event with the activeX api.
That's not correct. SendMousePointerEvent simply creates an RFB message with the arguments provided. It doesn't modify them in any way.
Regards,
Yury Averkiev,
SmartCode
Reply
Like
43
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Like
64
Similar Topics
Post Quoted Reply
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Facebook
Google
Explore
Messages
Mentions
Search