Sign in to follow this  
Followers 0
erifash

Opposite

7 posts in this topic

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!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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]

Share this post


Link to post
Share on other sites

Great job to the both of you.

Ian


"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Share this post


Link to post
Share on other sites

THATS REALLY NEAT!!!!!!! sry for the caps, its a hotkey for ventrilo :lmao:


FootbaG

Share this post


Link to post
Share on other sites

Simple but nice! I give u max mark because my little daugher find it very funny!


Ovoid

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0