Jump to content

Opposite


erifash
 Share

Recommended Posts

Hey, I was experimenting with opposite movement and found this example I made to be quite amusing.

Just click the button or press escape to exit.

#include <GUIConstants.au3>

HotkeySet("{ESC}", "myexit")

$gui = GUICreate("mirror", @DeskTopWidth + 5, @DesktopHeight, 0, 0, $WS_EX_TOPMOST + $WS_BORDER + $WS_POPUP, $WS_EX_TOOLWINDOW)
$b1 = GUICtrlCreateButton("", -20, -20, 20, 20)

GUISetState()

WinSetOnTop("mirror", "", 1)
GUISetBkColor(0xBBBBBB, $gui)

While 1
  $msg = GUIGetMsg()
  $pos = MouseGetPos()
  ControlMove("mirror", "", $b1, @DesktopWidth - $pos[0], @DesktopHeight - $pos[1])
  If $msg = $b1 Then Exit
  Sleep(10)
Wend

Func myexit()
  Exit
EndFunc

Any questions / comments would be greatly appreciated!

Link to comment
Share on other sites

lol thats awesome

you could probably even turn this into a game with levels and stuff, you get points depending on how fast you beat each level, level 1 has 1 button, level 2 has 2 buttons, etc

Edited by Xenogis

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

Replace $b = GuiCtrlCreateButton... with the following

DllCall("user32.dll", "int", "ShowCursor", "int", 0);HIDE CURSOR
$b1 = GuiCtrlCreateIcon(@WindowsDir & "\Cursors\arrow_m.cur", 0, 32, 32, 32, 32);fake cursor
MouseMove(@DesktopWidth/2, @DesktopHeight/2, 1);center the cursor

Let me know if it works for you :lmao:

Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

thats funny CyberSlug

Edited by Xenogis

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...