Move mouse pointer to to a specific position on a window

I’m trying to move the mouse cursor to a specific position on a window. (Windows 10)
Iv’e looked through some previous examples and threads (all of which I cant get to work)

I intend to restrict a user from entering a MoviePlayer area (MouseEnter) - so that a movie can play in the player without users being able to stop, full screen, right click etc. - and figure this is a way that might work.

I don’t think this is the right way to treat your users.

You may try to place a canvas over the player, and return true in the MouseDown event. It should prevent click.

You could also make the cursor invisible over the control. But yet people may then think the app is hung.

If you absolutely want to mistreat your users :
https://forum.xojo.com/12259-move-mouse-position-click-by-code-windows/0

Can’t make that work Michel - User can still right click or double click in Windows 10

Try making the cursor invisible over the player. It is not exactly nice, but it will be less invasive than moving the cursor.

I am not sure mouseenter and mouseexit fires on it. You may still need the canvas for that.

What if the user needs to pause/stop the movie so she can go to the toilet?

Its a quiz game that is time specific - toilet not possible while playing - no pausing etc
The video is just for the user to watch NOT TO STOP, PAUSE, FULL SCREEN, RIGHT CLICK etc.
Theres no mistreating of users - just trying to get around the user being able to stop the video and having more time to answer the questions.

Tried this in a button action (Windows 10) - Doesn’t seem to do anything Michel - cursor stays where it is.

#if TargetWin32
Declare Function SetCursorPos Lib “user32” (ByVal x As Integer, ByVal y As Integer) As Integer
//==========================================
// Set cursor position to top left of screen
//==========================================
call SetCursorPos(0,0)
#endif

I have no idea what you are doing wrong. It works perfectly here under Windows 10.

Make an effort, would you ?

Read carefully this http://documentation.xojo.com/index.php/MoviePlayer

What you want is already there.

Well Im running Windows 10
Xojo 2016 Release 3
I have a window (Window1)
I have a button (PushButton1)

In the buttons action event I have:

#if TargetWin32
Declare Function SetCursorPos Lib “user32” (ByVal x As Integer, ByVal y As Integer) As Integer
//==========================================
// Set cursor position to top left of screen
//==========================================
call SetCursorPos(0,0)
#endif

When I run the project and I click the button nothing happens - the cursor doesn’t move

[quote=301792:@Michel Bujardet]Make an effort, would you ?

Read carefully this http://documentation.xojo.com/index.php/MoviePlayer

What you want is already there.[/quote]

WHERE?..why not just tell me?
I thought this forum was for help?

I guarantee you it works flawlessly here, so you must be doing something wrong somewhere.

At any rate, read very carefully the controller part of the link I posted. there is what you want, and no need whatsoever to move the mouse.

The only thing I can see is setting the controls of the movie player to nothing
http://documentation.xojo.com/index.php/MoviePlayer.Controller

And handling the MouseMove event to move the mouse away…
http://documentation.xojo.com/index.php/RectControl.MouseMove

The easiest method would be using the canvas method, mentioned above, or just letting the end user being able to start/stop the video…

I tested with no controller in the Inspector. That works perfectly.

[quote=301802:@shao sean]The only thing I can see is setting the controls of the movie player to nothing
http://documentation.xojo.com/index.php/MoviePlayer.Controller

And handling the MouseMove event to move the mouse away…
http://documentation.xojo.com/index.php/RectControl.MouseMove

The easiest method would be using the canvas method, mentioned above, or just letting the end user being able to start/stop the video…[/quote]

The canvas method doesn’t work
Letting the user start/stop the video I’SNT AN OPTION - its a game that is time specific

Stuart, do you actually read the posts ?

http://documentation.xojo.com/index.php/MoviePlayer.Controller

Michel can you make a project of your example that works and make it available for download.
I can’t understand why it works for you and not for me

Stuart, you asked about a solution for the player. It is Controller.

As for mouse move, I posted everything back in 2014. But you don’t need it if you don’t display the player controls.

Are you using Preffered Player, Quicktime or Windows Media Player as MoviePlayer type?
Does a right click menu appear when you right click on the MoviePlayer?
Is a movie loaded into the player?
Is Play/Pause available on the right click menu?