AutoHotkey Community

It is currently May 26th, 2012, 5:27 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: July 2nd, 2005, 8:43 am 
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. :-)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 2nd, 2005, 10:41 am 
Offline

Joined: April 5th, 2005, 10:50 pm
Posts: 133
Read this (from the help file)
http://www.autohotkey.com/docs/scripts/ ... nNames.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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2005, 9:02 am 
How can i couple a command to the buttons?

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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2005, 9:36 am 
Offline

Joined: April 5th, 2005, 10:50 pm
Posts: 133
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)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2005, 10:09 am 
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?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2005, 10:18 am 
Offline

Joined: April 1st, 2004, 12:00 am
Posts: 87
Location: Philippines
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".


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: batto, BrandonHotkey, mrhobbeys, MSN [Bot], Mtes, perlsmith, Yahoo [Bot] and 64 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