Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello guys,

My question is really simple I want to change the text on messagebox buttons to something else

for example I want to make 'yes' button say 'sure'

can I do this ?

I did google this some while ago and I remember I couldnt find anything helpful so if somebody get me a google result it will be Embarrassing :-)


thanks in advance
:-)
Posted
Comments
Tarun.K.S 14-Apr-11 4:24am    
I am not sure whether that's possible but you can make a custom window for it.
Sergey Alexandrovich Kryukov 14-Apr-11 22:51pm    
That would much more appropriate thing to do (not for the novice by the way), compared to the method based on Hook, even though it's quite creative.
--SA
a1mimo 14-Apr-11 4:32am    
I know that, but its just I am too lazy and curious about it :-)
Thank you,

It is indeed possible.
There is a ready made class for this, here on CodeProject.
Just use the CodeProject Search feature!
Good luck!

If you really can't find it... try here: Localizing System MessageBox[^]
 
Share this answer
 
v2
Comments
a1mimo 14-Apr-11 5:01am    
Thank you Toli
I actually tried your advice and I was just reading it, you are a big help :-)
Tarun.K.S 14-Apr-11 5:56am    
Wow so it works!
girish sp 14-Apr-11 7:04am    
toli-i thought its not possible..easy way to do..good answer!!my 5
Sergey Alexandrovich Kryukov 14-Apr-11 22:49pm    
Great article (my 5 for the reference), great illustration of "Windows must die". Created absolutely inflexible MessageBox, but the Hook beats it.
--SA
I believe calling Win32 API is only one way how to achieve this. If I remember correctly this could be done by using SendMessage API function. But it needs to know handle of the "window"(button) intended for caption change.
 
Share this answer
 
Comments
a1mimo 14-Apr-11 4:34am    
can you suggest me an article or something to do so? I would appreciate this
Thank you,
Rampas Tomas 14-Apr-11 4:39am    
I found it just 2 clicks from here :)

http://www.codeproject.com/KB/cpp/dMsgBox.aspx
a1mimo 14-Apr-11 5:00am    
Thanks Rampas
I got it I appreciate your help :-)
girish sp 14-Apr-11 7:04am    
my 5!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900