Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f1:: ;get gui button pressed id
- WhichButton := DllCall("MessageBox", "Int", 0, "Str", "Press Yes or No", "Str", "Title of box", "Int", 4)
- MsgBox You pressed button #%WhichButton%.
- return
- F2:: ;mouse speed
- SPI_GETMOUSESPEED := 0x70
- SPI_SETMOUSESPEED := 0x71
- ; Retrieve the current speed so that it can be restored later:
- DllCall("SystemParametersInfo", "UInt", SPI_GETMOUSESPEED, "UInt", 0, "UIntP", OrigMouseSpeed, "UInt", 0)
- ; Now set the mouse to the slower speed specified in the next-to-last parameter (the range is 1-20, 10 is default):
- DllCall("SystemParametersInfo", "UInt", SPI_SETMOUSESPEED, "UInt", 0, "Ptr", 1, "UInt", 0)
- KeyWait F2 ; This prevents keyboard auto-repeat from doing the DllCall repeatedly.
- return
- F2 up::DllCall("SystemParametersInfo", "UInt", SPI_SETMOUSESPEED, "UInt", 0, "Ptr", OrigMouseSpeed, "UInt", 0) ; Restore the original speed.
- return
- f3:: ;display a MsgBox
- DllCall("user32\MessageBox", "Ptr",0, "Str","hello world", "Str","title", "UInt",0)
- ;using variables
- vPrompt := "hello world 2"
- vTitle := "title"
- DllCall("user32\MessageBox", "Ptr",0, "Str",vPrompt, "Str",vTitle, "UInt",0)
- f1::
- SetTimer, stuffhere, 5000
- Return
- f2::
- SetTimer, stuffhere, off
- Return
- stuffhere:
- msgbox, hi
- return
- f3::
- Random, rand, 1000, 10000
- msgbox,%rand%
- sleep, % rand
- msgbox, %rand% Later
- ;msgbox % rand
- ;sleep, % rand(5000,15000)
- f1::
- SetTimer, stuffhere, 5000
- Return
- f2::
- SetTimer, stuffhere, off
- Return
- stuffhere:
- msgbox, hi
- return
- f3::
- Random, rand, 1000, 10000
- msgbox,%rand%
- sleep, % rand
- msgbox, %rand% Later
- ;msgbox % rand
- ;sleep, % rand(5000,15000)
Advertisement
Add Comment
Please, Sign In to add comment