AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Are you bored? Try this AHK script out
Goto page Previous  1, 2
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Sat Jun 07, 2008 2:56 pm    Post subject: Which is your Favourite Software ? Reply with quote

Code:
Gui, Add, Button, x75 y120 w75 h20 -Theme, AutoHotkey
Gui, Add, Button, x+5 w75 h20 -Theme vAI , AutoIt3
Gui, Show,w306 h150, Which is your Favourite Software ?
OnMessage( 0x200, "M" )
Return

M() {
  MouseGetPos,,,, CID
  If ( CID = "Button2" ) {
    Random,x,5,230
    Random,y,5,130
    GuiControl, Movedraw, AI, x%x% y%y%
}}


Wink
_________________
Back to top
View user's profile Send private message
Rhys



Joined: 17 Apr 2007
Posts: 736
Location: Florida

PostPosted: Sun Jun 08, 2008 1:26 am    Post subject: Reply with quote

That's a good one - I often wanted to do something like that, but that would change the text of the button (swap choices when you mouseover the 'wrong' choice) - I haven't looked at OnMessage() too much before - It looks very useful!
_________________
[Join IRC!]

http://www.codeforcure.org/
Back to top
View user's profile Send private message
poetbox



Joined: 07 Jan 2007
Posts: 60

PostPosted: Sun Jun 08, 2008 1:34 am    Post subject: Reply with quote

any way to click it?Iv tried many times and failed at last.
Back to top
View user's profile Send private message
Rhys



Joined: 17 Apr 2007
Posts: 736
Location: Florida

PostPosted: Sun Jun 08, 2008 4:04 am    Post subject: Reply with quote

ControlClick Wink
_________________
[Join IRC!]

http://www.codeforcure.org/
Back to top
View user's profile Send private message
Z Gecko
Guest





PostPosted: Sun Jun 08, 2008 5:46 am    Post subject: Reply with quote

just to make shure, you don´t use your keybord to push that bad-button Rolling Eyes
Code:
Gui +LastFoundExist
MyGuiHWND := WinExist("A")
Gui, Add, Button, x75 y120 w75 h20 -Theme HwndMyButton1HWND, AutoHotkey
Gui, Add, Button, x+5 w75 h20 -Theme vAI HwndMyButton2HWND, AutoIt3
Gui, Show,w306 h150, Which is your Favourite Software ?
OnMessage( 0x200, "M" )
OnMessage( 0x102, "F" )
OnMessage( 0x101, "F" )

Return

M() {
  MouseGetPos,,,, CID
  If ( CID = "Button2" ) {
    Random,x,5,230
    Random,y,5,130
    GuiControl, Movedraw, AI, x%x% y%y%
}}

F()
{
   global
   GuiThreadInfoSize = 48
   VarSetCapacity(GuiThreadInfo, GuiThreadInfoSize)
   NumPut(GuiThreadInfoSize, GuiThreadInfo, 0)
   if not DllCall("GetGUIThreadInfo", uint, 0, str, GuiThreadInfo)
   {
       Errorlevel = 1
       return
   }
   CurrentFocus := NumGet(GuiThreadInfo, 12)
   if !ErrorLevel
   {
      if (CurrentFocus = MyButton2HWND)
         ControlFocus , , ahk_id %MyButton1HWND%
   }
   return
}
Back to top
Deller



Joined: 21 Nov 2007
Posts: 214
Location: 0x01101110

PostPosted: Mon Jun 09, 2008 4:21 pm    Post subject: Reply with quote

Ian wrote:
Zippo, I know how you did that, but I'll be quiet about it. Had me fooled for a while though.

same here lol
Back to top
View user's profile Send private message
Renchen
Guest





PostPosted: Mon Jun 09, 2008 6:45 pm    Post subject: Reply with quote

Zippo's program have error here:

NumPut(0, yinyang, 0, "UChar")

he tried to call noexisted function...anyone can help please?
Back to top
Rhys



Joined: 17 Apr 2007
Posts: 736
Location: Florida

PostPosted: Mon Jun 09, 2008 6:49 pm    Post subject: Reply with quote

Have you got the latest version of AHK?
_________________
[Join IRC!]

http://www.codeforcure.org/
Back to top
View user's profile Send private message
Renchen
Guest





PostPosted: Tue Jun 10, 2008 5:28 pm    Post subject: Reply with quote

okay thanks it is okay now, but it isnt work Sad my card stayed there
Back to top
krueger00



Joined: 14 Sep 2008
Posts: 8

PostPosted: Sun Sep 14, 2008 9:24 pm    Post subject: Reply with quote

---------------------------
New AutoHotkey Script.ahk
---------------------------
Error at line 48.

Line Text:    Handle :=  DllCall("CreateFile","str",file,"Uint",0x40000000
Error: This line does not contain a recognized action.

The program will exit.
---------------------------
OK
---------------------------


PLEZ HELP
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group