Jump to content

Rename MsgBox() Buttons


SmOke_N
 Share

Recommended Posts

  • Moderators

This was made because of a question in the Support Forum, it renames the MsgBox() buttons to what you want them to be... I'm not setting up any instructions, it's pretty straight forward.

;===============================================================================
;
;~ Function:        _MsgBoxChangeButtons()
;~ Desctiption      Changes the button text of a MsgBox()
;~ Version:     N/A
;~ Author:      SmOke_N
;~ Parameter(s):        
;~          $iMBFlag = Icon and or Flags (Type of buttons)
;~          $MBTitle = Title of MsgBox()
;~          $MBText = Text for the Body of the MsgBox()
;~          $MBButton1 = Text to change the first button
;~          $MBButton2 = Optional Param:  Text to change the second Button if applicable
;~          $MBButton3 = Optional Param:  Text to change the third Button if applicable
;~          $iMBTimeOut = Optional Param:  MsgBox() Time out
;~ Requirement(s):  AutoIt Beta 3.1xx
;~ Example:
;~          _MsgBoxChangeButtons(36, 'My Title', 'My Text', 'Button 1', 'Button 2', '', 3)
;~ Example Result:  Will turn out a MsgBox() instead of Yes and No button will be Button 1 and Button 2 with a time out of 3 seconds
;~ Return Value(s): Will return the value that was clicked in the MsgBox()
;
;===============================================================================oÝ÷ Ø&¥Ú-å«­¢+ÙÕ¹}5Í   ½á
¡¹    ÕÑѽ¹Ì ÀÌØí¥5    ±°ÀÌØí5   Q¥Ñ±°ÀÌØí5  QáаÀÌØí5        ÕÑѽ¸Ä°ÀÌØí5     ÕÑѽ¸ÈôÌäìÌäì°ÀÌØí5       ÕÑѽ¸ÌôÌäìÌäì°ÀÌØí¥5 Q¥µ=ÕÐôÀ¤(1½°ÀÌØí5 ¥±ô¥±=Á¸¡QµÁ¥ÈµÀìÌäìÀäÈí5¥Í5    
¹ÑáÐÌäì°È¤(1½°ÀÌØí5 1¥¹ÄôÌäí=ÁÐ ÅÕ½Ðí]¥¹]¥Ñ±äÅÕ½Ðì°À¤Ìäì(1½°ÀÌØí5  1¥¹ÈôÌäí]¥¹]¥Ð ÅÕ½ÐìÌäìµÀìÀÌØí5   Q¥Ñ±µÀìÌäìÅÕ½Ðì¤Ìäì(1½°ÀÌØí5    1¥¹ÌôÌäí
½¹Ñɽ±MÑQáÐ ÅÕ½ÐìÌäìµÀìÀÌØí5    Q¥Ñ±µÀìÌäìÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½Ðí ÕÑѽ¸ÄÅÕ½Ðì°ÅÕ½ÐìÌäìµÀìÀÌØí5     ÕÑѽ¸ÄµÀìÌäìÅÕ½Ðì¤Ìäì(1½°ÀÌØí5   1¥¹ÐôÌäí
½¹Ñɽ±MÑQáÐ ÅÕ½ÐìÌäìµÀìÀÌØí5    Q¥Ñ±µÀìÌäìÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½Ðí ÕÑѽ¸ÈÅÕ½Ðì°ÅÕ½ÐìÌäìµÀìÀÌØí5     ÕÑѽ¸ÈµÀìÌäìÅÕ½Ðì¤Ìäì(1½°ÀÌØí5   1¥¹ÔôÌäí
½¹Ñɽ±MÑQáÐ ÅÕ½ÐìÌäìµÀìÀÌØí5    Q¥Ñ±µÀìÌäìÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½Ðí ÕÑѽ¸ÌÅÕ½Ðì°ÅÕ½ÐìÌäìµÀìÀÌØí5     ÕÑѽ¸ÌµÀìÌäìÅÕ½Ðì¤Ìäì(%ÀÌØí5       ÕÑѽ¸ÈôÌäìÌäìQ¡¸(¥±]ɥѡQµÁ¥ÈµÀìÌäìÀäÈí5¥Í5    
¹ÑáÐÌäì°ÀÌØí5   1¥¹ÄµÀì
I1µÀìÀÌØí5   1¥¹ÈµÀì
I1µÀìÀÌØí5   1¥¹Ì¤(±Í%ÀÌØí5        ÕÑѽ¸È±ÐìÐìÌäìÌäì¹ÀÌØí5       ÕÑѽ¸ÌôÌäìÌäìQ¡¸(¥±]ɥѡQµÁ¥ÈµÀìÌäìÀäÈí5¥Í5    
¹ÑáÐÌäì°ÀÌØí5   1¥¹ÄµÀì
I1µÀìÀÌØí5   1¥¹ÈµÀì|(
I1µÀìÀÌØí5   1¥¹ÌµÀì
I1µÀìÀÌØí5   1¥¹Ð¤(±Í%ÀÌØí5        ÕÑѽ¸È±ÐìÐìÌäìÌäì¹ÀÌØí5       ÕÑѽ¸Ì±ÐìÐìÌäìÌäìQ¡¸(¥±]ɥѡQµÁ¥ÈµÀìÌäìÀäÈí5¥Í5    
¹ÑáÐÌäì°ÀÌØí5   1¥¹ÄµÀì
I1µÀìÀÌØí5   1¥¹ÈµÀì
I1µÀì|(ÀÌØí5 1¥¹ÌµÀì
I1µÀìÀÌØí5   1¥¹ÐµÀì
I1µÀìÀÌØí5   1¥¹Ô¤(¹%(ÀÌØí5 A%ÄôIÕ¸¡Õѽ%ÑáµÀìÌäì½Õѽ%ÐÍáÕÑMÉ¥ÁÐÌäìµÀì¹ÙÐ ÌäíQ5@Ìä줵ÀìÌäìÀäÈí5¥Í5  
¹ÑáÐÌäì¤(ÀÌØí5      ½àô5Í   ½à ÀÌØí¥5    ±°ÀÌØí5   Q¥Ñ±°ÀÌØí5  QáаÀÌØí¥5  Q¥µ=ÕФ(¥±
±½Í ÀÌØí5    ¥±¤(¼(¥±±Ñ¡QµÁ¥ÈµÀìÌäìÀäÈí5¥Í5 
¹ÑáÐÌäì¤(U¹Ñ¥°9½Ð¥±á¥ÍÑÌ¡QµÁ¥ÈµÀìÌäìÀäÈí5¥Í5  
¹ÑáÐÌäì¤(IÑÕɸÀÌØí5     ½à)¹Õ¹

Edit:

Provided a UDF break down.

Edit2:

Added herewasplatos suggestion of Opt('WinWaitDelay', 0) rather than While Not WinExists().

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

HI,

nice work. :D

But, isn't there any easier way doing that? :D

Looks as pretty much to do.

Thanks!

So long,

Mega

Edited by th.meger

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

You mean like some way of not having to use the temp file? I wish there was an autoit Obj you could just .document.write to.

Yeah, exactly. Any C++ guru in here? Maybe it can be done in some code lines. :D

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

This could come in useful! Well done.

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

Good job SmOke_N.

I've pointed to this thread from "the other one" where we played with the MsgBox:

http://www.autoitscript.com/forum/index.ph...showtopic=22531

One note - this code:

Local $MBLine1 = 'While Not WinExists("' & $MBTitle & '")'
    Local $MBLine2 = '    Sleep(10)'
    Local $MBLine3 = 'WEnd'
...could be an OPT line to reduce the winwaitdelay to 1 or 0 and then a winwait line. You might gain a few milliseconds in response time and lose one line of temp code.

Just a thought.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Love this script and added another parameter to it "$iMBIcon" taken from another script on this forum tho cant remember who.

It gives the abilty to hide the taskbar icon of the messagebox, the drawback being any wait time specified will be ignored.

Rick

Edit: added optional move messagebox option

MsgBoxChangeButtons_or_Move.au3

Edited by Rick

Who needs puzzles when we have AutoIt!!

Link to comment
Share on other sites

  • Moderators

Thanks for the suggestions, I added herewasplato's idea to this one, and will re-do the MoveMsgBox() UDF alteration I made with the same idea.

@Rick, that would throw things off as nice as it would be to add. I haven't figured out how to add a timer myself, but if someone knows how, I'll add that option in, but I can't have a potentially dead parameter if you know what I mean. Thanks for idea :D .

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I disagree as any unused parameter is a potentially dead one, and the more options the better surely?

Still, good luck with making it better.

Edited by Rick

Who needs puzzles when we have AutoIt!!

Link to comment
Share on other sites

  • Moderators

I disagree as any unused parameter is a potentially dead one, and the more options the better surely?

Still, good luck with making it better.

I meant, if the user of the UDF puts a timeout and still wants to hide the icon, then it won't do the timeout, therefore rendering the timeout a dead parameter for that call.

As I said, I like the idea, but I would like to know how to do the timeout with the DLL call, without having to do "another" /AutoIt3ExecuteScript with TimerInit()/TimerDiff() (Which as you can see from some of my other posts is not past me anyway).

Maybe one of the Devs can show us how they used the timeout parameter when they made the MsgBox() function.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...