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 

Changing the buttons of an input box

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Cracked-Nut
Guest





PostPosted: Sat Jul 02, 2005 8:43 am    Post subject: Changing the buttons of an input box Reply with quote

Hi peeepzzz!!!

How can i change the buttons of an inputbox,

Standard, they are OK and Cancel.

But i want other buttons, that i can choose.

How can i do that?

Cracked-Nut. Smile
Back to top
MYYM



Joined: 05 Apr 2005
Posts: 132

PostPosted: Sat Jul 02, 2005 10:41 am    Post subject: Reply with quote

Read this (from the help file)
http://www.autohotkey.com/docs/scripts/MsgBoxButtonNames.htm

and try this
Code:
SetTimer, CHCT, 10
InputBox,I,My Input Box
Return

CHCT:
IfWinNotExist, My Input Box, , return
SetTimer, CHCT, off
WinActivate
ControlSetText, Button1, &Do it
ControlSetText, Button2, Do&n't
Return
Back to top
View user's profile Send private message Visit poster's website
Cracked-Nut
Guest





PostPosted: Sun Jul 03, 2005 9:02 am    Post subject: Reply with quote

How can i couple a command to the buttons?

So if i click ''Do It!'', then there has to open a program??
Back to top
MYYM



Joined: 05 Apr 2005
Posts: 132

PostPosted: Sun Jul 03, 2005 9:36 am    Post subject: Reply with quote

Code:
SetTimer, CHCT, 10
InputBox,I,My Input Box,Program to run:,,,,,,,,Notepad
if (Errorlevel=0) ; if "Do it"
{
   Run,%i%
}
Return

CHCT:
IfWinNotExist, My Input Box, , return
SetTimer, CHCT, off
WinActivate
ControlSetText, Button1, &Do it
ControlSetText, Button2, Do&n't
return

Note:
press "Do it" to run notepad (the defult in this code) or type something else in the box then press "Do it"(ex: MSpaint to run Paint)
Back to top
View user's profile Send private message Visit poster's website
Cracked-Nut
Guest





PostPosted: Sun Jul 03, 2005 10:09 am    Post subject: Reply with quote

Strange, but if i run this script:

SetTimer, CHCT, 10
InputBox,I,My Program Runner,Program to run:,,,,,,,,Type in your program...
if (Errorlevel=0) ; if "Open"
{
Run,%i%
}
Return

CHCT:
IfWinNotExist, My Input Box, , return
SetTimer, CHCT, off
WinActivate
ControlSetText, Button1, Open
ControlSetText, Button2, Close
return


then i get the two standard-buttons,

Go and Cancel...

What's the problem?
Back to top
dijiyd



Joined: 01 Apr 2004
Posts: 90
Location: Philippines

PostPosted: Sun Jul 03, 2005 10:18 am    Post subject: Reply with quote

That's because in CHCT, you were checking if "My Input Box" does not exist at the time, if so, do nothing. It won't exist because you created "My Program Runner".
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
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