Click here to Skip to main content
15,880,392 members
Articles / Desktop Programming / Windows Forms
Article

MessageBox Translation Hook

Rate me:
Please Sign up or sign in to vote.
2.26/5 (12 votes)
18 Nov 2004 71.5K   2.8K   23   12
With this class (sample) you can translate system MessageBox to any language. HOOK

Sample Image - messageboxhook.jpg

Introduction

In short: With this class (sample) you can translate system MessageBox to any language. With fiew API functions it is easy to hook on system messagebox and catch messages that will provide you easy messagebox translation. You can use this to translate other dialogs like OpenFileDialog, SaveFileDialog, FolderDialog, ColorDialog, FontDialog, PrintDialog .. etc..

You can see here how you can use API functions in VB.NET, and how you can hook to any system dialog framework is providing for display.

Code is writen in VB.NET, but it easy to convert it to C#.


I dont know what else i can say about this, the thing is very trivial.


Enjoy,
Josip Habjan

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Croatia Croatia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionZIP CONTAINS A VIRUS Pin
rafp629-Apr-13 4:21
rafp629-Apr-13 4:21 
GeneralVery helpful Pin
Plamen Velikov2-Mar-11 2:59
Plamen Velikov2-Mar-11 2:59 
GeneralHSHELL_WINDOWCREATED Pin
Vitoto27-Dec-05 2:53
Vitoto27-Dec-05 2:53 
GeneralWindow title name Hook Pin
Vitoto7-Dec-05 8:24
Vitoto7-Dec-05 8:24 
GeneralC# conversion Pin
eliflio7-Nov-05 4:54
eliflio7-Nov-05 4:54 
Generalabout error Pin
Jagdish Vasani8-Feb-05 19:02
Jagdish Vasani8-Feb-05 19:02 
QuestionHOW TO CHANGE THE BACKGROUND COLOR OF MESSAGEBOX Pin
Anonymous26-Dec-04 21:43
Anonymous26-Dec-04 21:43 
AnswerRe: HOW TO CHANGE THE BACKGROUND COLOR OF MESSAGEBOX Pin
AaZocco12-Mar-05 12:09
AaZocco12-Mar-05 12:09 
GeneralRe: HOW TO CHANGE THE BACKGROUND COLOR OF MESSAGEBOX Pin
Md Shamirul Islam18-Oct-05 18:22
Md Shamirul Islam18-Oct-05 18:22 
General2 comments Pin
Eric Moreau15-Dec-04 2:36
Eric Moreau15-Dec-04 2:36 
Overall, it is a great add-on to current project. I have to develop multi-lingual apps and will surely use it.

I did found one small bug. This overload:
Public Overloads Shared Function Show( _
ByVal owner As System.Windows.Forms.IWin32Window, _
ByVal text As String) As System.Windows.Forms.DialogResult

Return Show(Nothing, text, String.Empty)
End Function

Should be:
Return Show(OWNER, text, String.Empty)


My second comments is why don't you try to limit the call chain? If you use:
CMessageBox.Show("Test string")

Your calling chain will include 7 calls to the overloaded Show methods! Instead each partial overload should call the final overload (where the actual code is):
Return Show(Nothing, text, String.Empty, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, Nothing)

GeneralLow score because of litte info Pin
Pål K Tønder18-Nov-04 5:20
Pål K Tønder18-Nov-04 5:20 
GeneralRe: Low score because of litte info Pin
Josip Habjan18-Nov-04 7:47
Josip Habjan18-Nov-04 7:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.