4 * This file contains Windows-specific interpreter initialization
7 * Copyright (c) 1995-1997 Sun Microsystems, Inc.
9 * See the file "license.terms" for information on usage and redistribution
10 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
18 * The Init script (common to Windows and Unix platforms) is
19 * defined in tkInitScript.h
21 #include "tkInitScript.h"
25 *----------------------------------------------------------------------
29 * Performs Windows-specific interpreter initialization related to the
30 * tk_library variable.
33 * A standard Tcl completion code (TCL_OK or TCL_ERROR). Also
34 * leaves information in interp->result.
37 * Sets "tk_library" Tcl variable, runs "tk.tcl" script.
39 *----------------------------------------------------------------------
46 return Tcl_Eval(interp, initScript);
50 *----------------------------------------------------------------------
54 * Retrieves the name of the current application from a platform
55 * specific location. For Windows, the application name is the
56 * root of the tail of the path contained in the tcl variable argv0.
59 * Returns the application name in the given Tcl_DString.
64 *----------------------------------------------------------------------
68 TkpGetAppName(interp, namePtr)
70 Tcl_DString *namePtr; /* A previously initialized Tcl_DString. */
73 char **argv = NULL, *name, *p;
75 name = Tcl_GetVar(interp, "argv0", TCL_GLOBAL_ONLY);
77 Tcl_SplitPath(name, &argc, &argv);
80 p = strrchr(name, '.');
88 if ((name == NULL) || (*name == 0)) {
91 Tcl_DStringAppend(namePtr, name, -1);
98 *----------------------------------------------------------------------
100 * TkpDisplayWarning --
102 * This routines is called from Tk_Main to display warning
103 * messages that occur during startup.
109 * Displays a message box.
111 *----------------------------------------------------------------------
115 TkpDisplayWarning(msg, title)
116 char *msg; /* Message to be displayed. */
117 char *title; /* Title of warning. */
119 MessageBox(NULL, msg, title, MB_OK | MB_ICONEXCLAMATION | MB_SYSTEMMODAL
120 | MB_SETFOREGROUND | MB_TOPMOST);