Click here to Skip to main content
Click here to Skip to main content
Go to top

MessageBox Translation Hook

, 18 Nov 2004
Rate this:
Please Sign up or sign in to vote.
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

Share

About the Author

Josip Habjan
Web Developer
Croatia Croatia
No Biography provided

Comments and Discussions

 
QuestionZIP CONTAINS A VIRUS Pinmemberrafp629-Apr-13 4:21 
GeneralVery helpful PinmemberPlamen Velikov2-Mar-11 2:59 
GeneralHSHELL_WINDOWCREATED PinmemberVitoto27-Dec-05 2:53 
GeneralWindow title name Hook PinmemberVitoto7-Dec-05 8:24 
GeneralC# conversion Pinmembereliflio7-Nov-05 4:54 
Generalabout error Pinmemberjags_vc8-Feb-05 19:02 
QuestionHOW TO CHANGE THE BACKGROUND COLOR OF MESSAGEBOX PinsussAnonymous26-Dec-04 21:43 
AnswerRe: HOW TO CHANGE THE BACKGROUND COLOR OF MESSAGEBOX PinsussAaZocco12-Mar-05 12:09 
GeneralRe: HOW TO CHANGE THE BACKGROUND COLOR OF MESSAGEBOX PinsussMd Shamirul Islam18-Oct-05 18:22 
General2 comments Pinmemberemoreau15-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 PinmemberPål K Tønder18-Nov-04 5:20 
GeneralRe: Low score because of litte info PinmemberJosip Habjan18-Nov-04 7:47 

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

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

| Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 18 Nov 2004
Article Copyright 2004 by Josip Habjan
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid