 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Cracked-Nut Guest
|
Posted: Sat Jul 02, 2005 8:43 am Post subject: Changing the buttons of an input box |
|
|
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.  |
|
| Back to top |
|
 |
MYYM
Joined: 05 Apr 2005 Posts: 132
|
Posted: Sat Jul 02, 2005 10:41 am Post subject: |
|
|
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 |
|
 |
Cracked-Nut Guest
|
Posted: Sun Jul 03, 2005 9:02 am Post subject: |
|
|
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
|
Posted: Sun Jul 03, 2005 9:36 am Post subject: |
|
|
| 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 |
|
 |
Cracked-Nut Guest
|
Posted: Sun Jul 03, 2005 10:09 am Post subject: |
|
|
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
|
Posted: Sun Jul 03, 2005 10:18 am Post subject: |
|
|
| 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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|