AutoHotkey Community

It is currently May 27th, 2012, 1:13 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: June 7th, 2008, 3:56 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
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:

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 8th, 2008, 2:26 am 
Offline

Joined: April 17th, 2007, 1:37 pm
Posts: 761
Location: Florida
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!]
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 8th, 2008, 2:34 am 
Offline

Joined: January 7th, 2007, 1:43 pm
Posts: 107
any way to click it?Iv tried many times and failed at last.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 8th, 2008, 5:04 am 
Offline

Joined: April 17th, 2007, 1:37 pm
Posts: 761
Location: Florida
ControlClick :wink:

_________________
[Join IRC!]
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 8th, 2008, 6:46 am 
just to make shure, you don´t use your keybord to push that bad-button :roll:
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
}


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 9th, 2008, 5:21 pm 
Offline

Joined: November 21st, 2007, 10:27 pm
Posts: 239
Location: 0x01101110
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 9th, 2008, 7:45 pm 
Zippo's program have error here:

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

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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 9th, 2008, 7:49 pm 
Offline

Joined: April 17th, 2007, 1:37 pm
Posts: 761
Location: Florida
Have you got the latest versionof AHK?

_________________
[Join IRC!]
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 10th, 2008, 6:28 pm 
okay thanks it is okay now, but it isnt work :( my card stayed there


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 14th, 2008, 10:24 pm 
Offline

Joined: September 14th, 2008, 10:22 pm
Posts: 10
---------------------------
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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bon and 14 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group