KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: How to remember mouse position and return to it?
Topic Summary:
Created On: 01/05/2018 06:04 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 How to remember mouse position and return to it?   - avkatz - 01/05/2018 06:04 PM  
 How to remember mouse position and return to it?   - Lunis Orcutt - 01/05/2018 06:34 PM  
 How to remember mouse position and return to it?   - avkatz - 01/05/2018 06:53 PM  
 How to remember mouse position and return to it?   - avkatz - 01/05/2018 06:57 PM  
 How to remember mouse position and return to it?   - Grindcore - 01/05/2018 10:26 PM  
 How to remember mouse position and return to it?   - avkatz - 01/06/2018 10:02 AM  
 How to remember mouse position and return to it?   - Mark Bennett - 06/01/2018 04:51 PM  
 How to remember mouse position and return to it?   - Mphillipson - 06/03/2018 03:46 PM  
 How to remember mouse position and return to it?   - Ag - 09/07/2019 03:50 PM  
 How to remember mouse position and return to it?   - kkkwj - 12/23/2020 10:49 PM  
Keyword
 01/05/2018 10:26 PM
User is offline View Users Profile Print this message

Author Icon
Grindcore
Power Member

Posts: 73
Joined: 07/17/2015

You can store your mouse position in a variable by putting this code at the start of your script (before Sub Main):

 

Type POINTAPI

xx As Long

yy As Long

End Type


Declare Function GetCursorPos Lib "user32" _

  Alias "GetCursorPos" (lpPoint As POINTAPI) As Long


Private Mpos As POINTAPI


Sub Main

Now here goes your script as usual, but to store the mouse position, you can now use this use this:

 

GetCursorPos Mpos

 

This will store your cursor's location X and Y coordinates in the variables Mpos.xx and Mpos.yy

And to put your cursor at the stored coordinates you can use this:

 

SetMousePosition 0,Mpos.xx,Mpos.yy

 



Statistics
32133 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 3 users logged in.
The most users ever online was 12124 on 09/09/2020 at 04:59 AM.
There are currently 421 guests browsing this forum, which makes a total of 424 users using this forum.

FuseTalk Standard Edition v4.0 - © 1999-2021 FuseTalk™ Inc. All rights reserved.