MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / WinMain

Function WinMain

SRC/tcl/winMain.cpp:108–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106 *----------------------------------------------------------------------
107 */
108
109int APIENTRY
110WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
111{
112 char **argv;
113 int argc;
114 char buffer[MAX_PATH+1];
115 char *p;
116
117 Tcl_SetPanicProc(WishPanic);
118
119 /*
120 * Increase the application queue size from default value of 8.
121 * At the default value, cross application SendMessage of WM_KILLFOCUS
122 * will fail because the handler will not be able to do a PostMessage!
123 * This is only needed for Windows 3.x, since NT dynamically expands
124 * the queue.
125 */
126
127 SetMessageQueue(64);
128
129 /*
130 * Create the console channels and install them as the standard
131 * channels. All I/O will be discarded until Tk_CreateConsoleWindow is
132 * called to attach the console to a text widget.
133 */
134
135 consoleRequired = TRUE;
136
137 /*
138 * Set up the default locale to be standard "C" locale so parsing
139 * is performed correctly.
140 */
141
142 setlocale(LC_ALL, "C");
143 setargv(&argc, &argv);
144
145 /*
146 * Replace argv[0] with full pathname of executable, and forward
147 * slashes substituted for backslashes.
148 */
149
150 GetModuleFileName(NULL, buffer, sizeof(buffer));
151 argv[0] = buffer;
152 for (p = buffer; *p != '\0'; p++) {
153 if (*p == '\\') {
154 *p = '/';
155 }
156 }
157
158#ifdef TK_LOCAL_MAIN_HOOK
159 TK_LOCAL_MAIN_HOOK(&argc, &argv);
160#endif
161
162 Tk_MainOpenSees(argc, argv, TK_LOCAL_APPINIT, Tcl_CreateInterp());
163 return 1;
164}
165

Callers

nothing calls this directly

Calls 2

Tk_MainOpenSeesFunction · 0.85
setargvFunction · 0.70

Tested by

no test coverage detected