Jump to content

Search the Community

Showing results for tags 'mousetrap'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hey everyone, Since I haven't yet created anything that isn't specific to my job, and haven't ever posted any examples, I figured I would share this little script I made a while ago for fun between projects. #include <GUIConstants.au3> #include <Misc.au3> HotKeySet("{F9}", "Start") HotKeySet("{ESC}", "Stop") Func Start() Local $hGUI = GUICreate("Transparent GUI", @DesktopWidth, @DesktopHeight, -1, -1, $WS_POPUP, $WS_EX_TOPMOST) Local $i,$j GUISetBkColor(0) WinSetTrans($hGUI, "", 50) GUISetState(@SW_SHOW, $hGUI) For $i=0 To 1040 Step 1 _Middle($hGUI, "", @DesktopWidth-$i, @DesktopHeight-$i) $winCoord = WinGetPos($hGUI) _MouseTrap($winCoord[0],$winCoord[1],($winCoord[0] + $winCoord[2])-5,($winCoord[1] + $winCoord[3])-5) Next For $j=0 to 840 Step 1 _Middle($hGUI, "", @DesktopWidth-$i-$j, @DesktopHeight-$i) $winCoord = WinGetPos($hGUI) _MouseTrap($winCoord[0],$winCoord[1],($winCoord[0] + $winCoord[2])-5,($winCoord[1] + $winCoord[3])-5) Next ToolTip("Your mouse has been trapped!", @DesktopWidth/2-80,@DesktopHeight/2+22) While 1 Sleep(10) WEnd EndFunc ;==> While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func _Middle($win, $txt, $width=-1, $height=-1) If $width >= 0 Or $height >= 0 Then Local $aWin = WinGetPos($win) If $width < 0 Then $width = $aWin[2] If $height < 0 Then $height = $aWin[3] WinMove($win, $txt, $aWin[0], $aWin[1], $width, $height) ; first winmove EndIf Local $size = WinGetClientSize($win, $txt) Local $y = (@DesktopHeight / 2) - ($size[1] / 2) Local $x = (@DesktopWidth / 2) - ($size[0] / 2) Return WinMove($win, $txt, $x, $y) ; second winmove EndFunc ;==>_Middle Func Stop() _MouseTrap() Exit EndFunc ;==>Stop It creates a transparent GUI that slowly shrinks, trapping your mouse inside! I created it after discovering the _MouseTrap() function in the helpfile and the idea floated into my head. It has no real purpose other than entertainment. I figured between all of the serious scripts we use here a little fun is always a nice break F9 to start, ESC to exit at any time. If this is against the rules feel free to remove it, I didn't see any place this would fall under.
×
×
  • Create New...