Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Changing Messagebox Button Labels

cacciatore
Beginner
1,002 Views
I WOULD LIKE TO HAVE HELP IN THE FOLLOWING QUESTIONS:

1- HOW IS IT POSSIBLE TO CHANGE THE LABELS OF THE BUTTONS OF A MESSAGEBOX ( NOT MESSAGEBOXQQ).

2- HOW TO CREATE A MODELES MESSAGEBOX WITH NO BUTTONS AND ONLY A MESSAGE LIKE:
'WAIT, PROGRAM XX RUNNING', AND AFTER XX TERMINATES CLOSING, BY CODE, THE MESSAGEBOX.
CREATING A MODELES DIALOG AND USE DIALOGEXIT WOULD DO IT, BUT I HOPE THERE IS SOMETHING THAT DEMANDS LESS CODING.

THANKS
GERALDO
0 Kudos
7 Replies
Jugoslav_Dujic
Valued Contributor II
1,002 Views
You answered your questions yourself -- MessageBox has only a small set of predefined button labels (Yes, No, OK, Cancel...) -- for everything more you should create a dialog of your own. The same for question 2 -- by the time you wrote the post here, you could have coded it yourself ;-).

Jugoslav
0 Kudos
cacciatore
Beginner
1,002 Views
Jugoslav

For the question 2 you are rigth.
As for the question 1, I wanted to change YES and NO to portuguese. The first time I used YES and NO buttons, just before receiving your answer, I found the brazilian version of W98 have all the labels in portuguese. As I have been using messagebox with only OK button, I was not aware of it. I should be aware, as almost everything is translated in my W98.

Thanks for you answer
Geraldo
0 Kudos
cacciatore
Beginner
1,002 Views
Forgot another question:

In messages using null terminating strings ( aboutbox for example) creates a new line. In messagebox is treated as a normal character. How to do it in messagebox?

Thanks
Geraldo
0 Kudos
llynisa
Beginner
1,002 Views
Just add a CHAR(0) after /r

Regards

Alan
0 Kudos
llynisa
Beginner
1,002 Views
Just add a CHAR(0) after

Regards

Alan
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,002 Views
No. is how CHAR(13) is spelled in C; similarly, stands for CHAR(10). How the escape sequence in the code is interpreted in CVF depends on whether "C" suffix is added to the string. Thus:
"Hello world
I'm here."C
"Hello world"//char(13)//char(10)//"I'm here."//char(0)

produce identical result -- the first is interpreted according to C parsing rules, the second according to Fortran's. I forgot what is required in MessageBox to indicate line break -- I think char(13) ( ), but try char(10) or char(13)//char(10) if it's not.

On a similar issue, since backslash is escape character in C, you have to spell to get a literal backslash, i.e:
"C:WinNTSystem32"C
(= "C:WinntSystem32"//char(0))
It's one of common errors in C to forget to type double backslashes when you want one -- it comes out about once a week in comp.os.ms-windows.programmer.win32: "why does my call to CreateFile returns 'File not found'"? ;-).

Jugoslav
0 Kudos
cacciatore
Beginner
1,002 Views
Alan, thanks for answering.
Jugoslav, char(13)//char(10) worked ok in messagebox. Thanks
As for it made me lose some time before "discovering" .
0 Kudos
Reply