diff options
author | hobbs <hobbs> | 2001-12-28 02:14:41 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2001-12-28 02:14:41 (GMT) |
commit | 183347a13d03489de00458ae395aee079a46f5bf (patch) | |
tree | a96d5ea0f37b3ce191d5d170fb8c3bdeb3743f1b | |
parent | 55cadfce54f12ad6a8387ac8b743e6ae519ab123 (diff) | |
download | tk-183347a13d03489de00458ae395aee079a46f5bf.zip tk-183347a13d03489de00458ae395aee079a46f5bf.tar.gz tk-183347a13d03489de00458ae395aee079a46f5bf.tar.bz2 |
* win/tkWinInit.c (TkpDisplayWarning): Use MessageBoxW in case the
error displayed has unicode chars. [Bug #485986]
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | win/tkWinInit.c | 11 |
2 files changed, 14 insertions, 2 deletions
@@ -1,3 +1,8 @@ +2001-12-27 Jeff Hobbs <jeffh@ActiveState.com> + + * win/tkWinInit.c (TkpDisplayWarning): Use MessageBoxW in case the + error displayed has unicode chars. [Bug #485986] + 2001-12-27 Daniel Steffen <das@users.sourceforge.net> * mac/tkMacInit.c: diff --git a/win/tkWinInit.c b/win/tkWinInit.c index 8426551..f071eef 100644 --- a/win/tkWinInit.c +++ b/win/tkWinInit.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinInit.c,v 1.4 2000/03/31 09:24:27 hobbs Exp $ + * RCS: @(#) $Id: tkWinInit.c,v 1.5 2001/12/28 02:14:41 hobbs Exp $ */ #include "tkWinInt.h" @@ -122,6 +122,13 @@ TkpDisplayWarning(msg, title) char *msg; /* Message to be displayed. */ char *title; /* Title of warning. */ { - MessageBox(NULL, msg, title, MB_OK | MB_ICONEXCLAMATION | MB_SYSTEMMODAL + Tcl_Encoding unicodeEncoding = Tcl_GetEncoding(NULL, "unicode"); + Tcl_DString msgString, titleString; + + Tcl_UtfToExternalDString(unicodeEncoding, msg, -1, &msgString); + Tcl_UtfToExternalDString(unicodeEncoding, title, -1, &titleString); + MessageBoxW(NULL, (WCHAR *) Tcl_DStringValue(&msgString), + (WCHAR *) Tcl_DStringValue(&titleString), + MB_OK | MB_ICONEXCLAMATION | MB_SYSTEMMODAL | MB_SETFOREGROUND | MB_TOPMOST); } |