Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Any one use Mini Mouse Macro?

06 May 2019   #1
iknowjohnny

windows 7 professional
 
 
Any one use Mini Mouse Macro?

I need help and thier forum is useless with the most recent posts being weeks old. Basically all i need is what to add to the end of the following macro script so that once it's doe running it's last function is to close the mini mouse macro script, If anyone knows i'd appreciate it. I googled it quite an while and cant find an answer. Thanks.


1212 | 26 | 5 | Left Click

839 | 525 | 9678 | Keypress `

839 | 525 | 10 | Keypress o

839 | 525 | 10 | Keypress p

839 | 525 | 10 | Keypress e

839 | 525 | 10 | Keypress n

839 | 525 | 10 | Keypress SPACE
839 | 525 | 10 | Keypress 1

839 | 525 | 10 | Keypress ENTER


My System SpecsSystem Spec
.
4 Weeks Ago   #2
Muted

Windows 7 Lite: Professional 64-bit
 
 

Hello, iknowjohnny.

I'm unsure about "Mini Mouse Macro" itself, but! There are quite a few (by that I mean: There are tons) of alternatives!
  • Visual Basic script (native to Windows)
  • AutoHotKey
  • AutoIt (branched expansion / spin-off of AutoHotKey)

These are my three favorite go-to scripting languages when it comes to emulating mouse input (computer scripting).

To emulate a mouse click with VBS (from start to finish):
  • Create a file and name it: "W7Forums.vbs"
  • Edit the newly created: "W7Forums.vbs" file with your favorite text editor (I usually use: Notepad++ or Notepad)
  • Copy and paste the script from below and edit it as needed

This is copied from a StackOverflow post (sending key emulating is much shorter and doesn't require that you link against DLL API calls):
Code:
'Declare mouse events
Public Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Public 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)
Public Const MOUSEEVENTF_LEFTDOWN = &H2
Public Const MOUSEEVENTF_LEFTUP = &H4
Public Const MOUSEEVENTF_RIGHTDOWN As Long = &H8
Public Const MOUSEEVENTF_RIGHTUP As Long = &H10
'Declare sleep
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

' Window location
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
Type RECT
  Left As Long
  Top As Long
  Right As Long
  Bottom As Long
End Type

Public Function WindowHandle(ByVal sTitle As String) As Long
    WindowHandle = FindWindow(vbNullString, sTitle)
End Function

Public Sub SendClick(sWnd As String, b As Integer, x As Long, y As Long)
    Dim pWnd As Long, pRec As RECT

    pWnd = WindowHandle(sWnd)
    GetWindowRect pWnd, pRec

    SetCursorPos pRec.Left + x, pRec.Top + y
    Sleep 50
    If b = 2 Then
        mouse_event MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0
        Sleep 50
        mouse_event MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0
    ElseIf b <> -1 Then
        mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
        Sleep 50
        mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
    End If
End Sub
If you want to emulate mouse clicks with AutoIt: You will need to install AutoIt first.
In terms of security: It opens another vector of attack (put bluntly). In practicality? It's not worth mentioning that.

To do exactly what you have above with AutoIt:
Code:
MouseClick($MOUSE_CLICK_LEFT, 1212, 26, 5) ; Send the left mouse click 5 times (10ms delay) at: 1212, 26 (X, Y coordinates)
Send("'open{SPACE}1{RETURN}") ; Sends the string of text
Normally, you can find the answer on Google itself. There are typically answers all over the place.
As with any form of research: You must filter out or modify the data you find from various sites.
My System SpecsSystem Spec
4 Weeks Ago   #3
iknowjohnny

windows 7 professional
 
 

Thanks, but i have no idea about code of any type. this was a WYSIWYG type of app. It;s pretty obvious they way it writes it out tho as in my post so i understand that. But the VBS code you wrote out i have no idea what it means or what to edit in it. I DID however assume you created it to mimic what i posted so i renamed it to the vbs extension and ran it and it gives me the error line 2, character 16, expected end of statement, code 800A0401, and microsoft VB script compilation error. By the way, i found the reason the MMM app won't close after using it....theres an option to do that but that feature is only functional if you buy the app.
My System SpecsSystem Spec
.

4 Weeks Ago   #4
Muted

Windows 7 Lite: Professional 64-bit
 
 

Quote   Quote: Originally Posted by iknowjohnny View Post
Thanks, but i have no idea about code of any type. this was a WYSIWYG type of app. It;s pretty obvious they way it writes it out tho as in my post so i understand that. But the VBS code you wrote out i have no idea what it means or what to edit in it. I DID however assume you created it to mimic what i posted so i renamed it to the vbs extension and ran it and it gives me the error line 2, character 16, expected end of statement, code 800A0401, and microsoft VB script compilation error. By the way, i found the reason the MMM app won't close after using it....theres an option to do that but that feature is only functional if you buy the app.
It helps to read persons posts all the way through. I didn't write it to look cool or for someone else to read. I wrote it for you to read in all it's entirety.

The VB script loads the user32.dll function addresses and copies them to a temporary variable (to be called later).
It then invokes those functions when you need them and where you need them. It's a fairly simple script.

I'd suggest you download AutoItv3 instead and learn how to write simple scripts for mouse/keyboard emulation.
The AutoIt forums are super active the last time I checked years ago.

I am a huge fan of AutoIt if you can't tell. I seldom use it, but it is a very powerful scripting language.
The online documentation is also incredibly useful. I believe there's even an offline copy if you desire it.

They normally provide full fledged examples (in the event you can't decipher the man pages).
My System SpecsSystem Spec
4 Weeks Ago   #5
iko22

Windows 7 x64, Vista x64, 8.1 smartphone
 
 

I found this, Close mmm automatically | MMM

I can see from the photo, that the easiest way to acomplish your request is to tick the checkbox called Exit and close after Macro end, found in the options tab.
My System SpecsSystem Spec
4 Weeks Ago   #6
iknowjohnny

windows 7 professional
 
 

Thanks. I used that kill process line in that link, but it only works with the newer version so i downloaded that.
My System SpecsSystem Spec
Reply

 Any one use Mini Mouse Macro?




Thread Tools




Similar help and support threads
Thread Forum
HP Mini crispified my mouse adapter?
I left a mouse adapter inside the USB port of my HP Mini laptop. I never used the mouse, but kept it in there just incase. Never gave me any problems until i noticed a burning smell coming from the case. I started receiving tooltips in the corner that the adapter wasn't being recognized, and so i...
Hardware & Devices
Need To Create A Macro!
I currently have a spreadsheet that I use to record monthly payments, so that I can see how much my new balance is and how many more payments I have left. There are several different items over several rows in the table on the spreadsheet, so when I have made a payment I have to work out each...
Microsoft Office
Slow Mouse and mini freeze
Hello ! I have just installed Seven(7100), I like it (it seems like a better Vista version :)) but I have some mouse issues, it is a bit hard to explain but when I rollover a link, a folder, a button ... it freezes for few millisecs. Is it a video driver problem ? A mouse driver problem ? ...
Hardware & Devices
outlook macro's - how
is there anyway to copy macro's from word to outlook 2010, tried and got an error. the type of macro that i'm talking abput are to switch different font's with a mouse click, size's or set sentences - words that have to be repeated many times (on many different days, so copy clips will not really...
Microsoft Office
Unboxing the new Microsoft Explorer Mini Mouse
More...
News


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 00:27.
Twitter Facebook