annotate nt/runemacs.c @ 369:1d62742628b6 r21-1-14

Import from CVS: tag r21-1-14
author cvs
date Mon, 13 Aug 2007 11:01:51 +0200
parents a4f53d9b3154
children cc15677e0335
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
1 /*
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
2 Simple program to start Emacs with its console window hidden.
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
3
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
4 This program is provided purely for convenience, since most users will
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
5 use Emacs in windowing (GUI) mode, and will not want to have an extra
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
6 console window lying around. */
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
7
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
8 /*
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
9 You may want to define this if you want to be able to install updated
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
10 emacs binaries even when other users are using the current version.
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
11 The problem with some file servers (notably Novell) is that an open
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
12 file cannot be overwritten, deleted, or even renamed. So if someone
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
13 is running emacs.exe already, you cannot install a newer version.
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
14 By defining CHOOSE_NEWEST_EXE, you can name your new emacs.exe
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
15 something else which matches "emacs*.exe", and runemacs will
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
16 automatically select the newest emacs executeable in the bin directory.
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
17 (So you'll probably be able to delete the old version some hours/days
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
18 later).
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
19 */
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
20
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
21 /* #define CHOOSE_NEWEST_EXE */
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
22
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
23 #define WIN32
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
24
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
25 #include <windows.h>
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
26 #include <string.h>
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
27 #include <malloc.h>
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
28
290
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
29 #if defined(__CYGWIN32__)
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
30 #include <sys/types.h>
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
31 #include <sys/stat.h>
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
32 #endif
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
33
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
34 int WINAPI
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
35 WinMain (HINSTANCE hSelf, HINSTANCE hPrev, LPSTR cmdline, int nShow)
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
36 {
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
37 STARTUPINFO start;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
38 SECURITY_ATTRIBUTES sec_attrs;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
39 SECURITY_DESCRIPTOR sec_desc;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
40 PROCESS_INFORMATION child;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
41 int wait_for_child = FALSE;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
42 DWORD ret_code = 0;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
43 char *new_cmdline;
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
44 char *basename;
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
45 char *p;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
46 char modname[MAX_PATH];
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
47
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
48 if (!GetModuleFileName (NULL, modname, MAX_PATH))
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
49 goto error;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
50 if ((p = strrchr (modname, '\\')) == NULL)
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
51 goto error;
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
52
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
53 basename = alloca(strlen(p) + 1);
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
54 strcpy (basename, p + 1);
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
55
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
56 *p = 0;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
57
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
58 new_cmdline = alloca (MAX_PATH + strlen (cmdline) + 1);
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
59 strcpy (new_cmdline, modname);
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
60
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
61 #ifdef CHOOSE_NEWEST_EXE
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
62 {
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
63 /* Silly hack to allow new versions to be installed on
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
64 server even when current version is in use. */
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
65
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
66 char * best_name = alloca (MAX_PATH + 1);
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
67 FILETIME best_time = {0,0};
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
68 WIN32_FIND_DATA wfd;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
69 HANDLE fh;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
70 p = new_cmdline + strlen (new_cmdline);
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
71 strcpy (p, "\\xemacs*.exe ");
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
72 fh = FindFirstFile (new_cmdline, &wfd);
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
73 if (fh == INVALID_HANDLE_VALUE)
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
74 goto error;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
75 do
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
76 {
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
77 if (wfd.ftLastWriteTime.dwHighDateTime > best_time.dwHighDateTime
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
78 || (wfd.ftLastWriteTime.dwHighDateTime == best_time.dwHighDateTime
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
79 && wfd.ftLastWriteTime.dwLowDateTime > best_time.dwLowDateTime))
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
80 {
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
81 best_time = wfd.ftLastWriteTime;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
82 strcpy (best_name, wfd.cFileName);
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
83 }
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
84 }
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
85 while (FindNextFile (fh, &wfd));
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
86 FindClose (fh);
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
87 *p++ = '\\';
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
88 strcpy (p, best_name);
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
89 strcat (p, " ");
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
90 }
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
91 #else
290
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
92 #if defined(__CYGWIN32__)
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
93 {
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
94 struct stat stbuf;
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
95 char sym_link_name[MAX_PATH+1], real_name[MAX_PATH+1];
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
96
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
97 strcpy(sym_link_name, new_cmdline);
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
98 if (strcmp(basename, "rungnuclient.exe") == 0)
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
99 strcat(new_cmdline, "\\gnuclient.exe ");
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
100 else if (strcmp(basename, "runemacs.exe") == 0)
290
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
101 {
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
102 strcat(sym_link_name, "\\xemacs");
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
103
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
104 if (lstat(sym_link_name, &stbuf) == 0)
290
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
105 {
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
106 if ((stbuf.st_mode & S_IFLNK) == S_IFLNK)
290
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
107 {
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
108 if (readlink(sym_link_name, real_name, sizeof(real_name)) == -1)
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
109 {
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
110 MessageBox (NULL, "Error reading symbolic link for xemacs",
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
111 "Error", MB_ICONSTOP);
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
112 return 1;
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
113 }
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
114 else
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
115 {
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
116 strcat(new_cmdline, "\\");
367
a4f53d9b3154 Import from CVS: tag r21-1-13
cvs
parents: 321
diff changeset
117 /* #### Horrible kludge to get round 1.1.6 bug in readlink. */
a4f53d9b3154 Import from CVS: tag r21-1-13
cvs
parents: 321
diff changeset
118 p = strrchr (real_name, '.');
a4f53d9b3154 Import from CVS: tag r21-1-13
cvs
parents: 321
diff changeset
119 if (p[1] == 'e' || p[1] == 'E'
a4f53d9b3154 Import from CVS: tag r21-1-13
cvs
parents: 321
diff changeset
120 && p[2] == 'x' || p[2] == 'X'
a4f53d9b3154 Import from CVS: tag r21-1-13
cvs
parents: 321
diff changeset
121 && p[3] == 'e' || p[3] == 'E')
a4f53d9b3154 Import from CVS: tag r21-1-13
cvs
parents: 321
diff changeset
122 p[4] = 0;
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
123 strcat(new_cmdline, real_name);
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
124 strcat(new_cmdline, " ");
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
125 }
290
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
126 }
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
127 else
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
128 strcat(new_cmdline, "\\xemacs ");
290
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
129 }
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
130 else
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
131 {
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
132 MessageBox (NULL, "can't locate XEmacs executable",
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
133 "Error", MB_ICONSTOP);
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
134 return 1;
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
135 }
290
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
136 }
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
137 }
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
138 #else
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
139 if (strcmp(basename, "rungnuclient.exe") == 0)
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
140 strcat (new_cmdline, "\\gnuclient.exe ");
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
141 else
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
142 strcat (new_cmdline, "\\xemacs.exe ");
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
143 #endif
290
c9fe270a4101 Import from CVS: tag r21-0b43
cvs
parents: 183
diff changeset
144 #endif
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
145
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
146 /* Append original arguments if any; first look for -wait as first
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
147 argument, and apply that ourselves. */
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
148 if (strncmp (cmdline, "-wait", 5) == 0)
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
149 {
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
150 wait_for_child = TRUE;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
151 cmdline += 5;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
152 }
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
153 strcat (new_cmdline, cmdline);
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
154
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
155 /* Set emacs_dir variable if runemacs was in "%emacs_dir%\bin". */
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
156 if ((p = strrchr (modname, '\\')) && stricmp (p, "\\bin") == 0)
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
157 {
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
158 *p = 0;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
159 for (p = modname; *p; p++)
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
160 if (*p == '\\') *p = '/';
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
161 SetEnvironmentVariable ("emacs_dir", modname);
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
162 }
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
163
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
164 memset (&start, 0, sizeof (start));
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
165 start.cb = sizeof (start);
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
166 start.dwFlags = STARTF_USESHOWWINDOW;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
167 start.wShowWindow = SW_HIDE;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
168
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
169 sec_attrs.nLength = sizeof (sec_attrs);
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
170 sec_attrs.lpSecurityDescriptor = NULL;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
171 sec_attrs.bInheritHandle = FALSE;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
172
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
173 if (CreateProcess (NULL, new_cmdline, &sec_attrs, NULL, TRUE, 0,
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
174 NULL, NULL, &start, &child))
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
175 {
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
176 if (wait_for_child)
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
177 {
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
178 WaitForSingleObject (child.hProcess, INFINITE);
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
179 GetExitCodeProcess (child.hProcess, &ret_code);
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
180 }
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
181 CloseHandle (child.hThread);
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
182 CloseHandle (child.hProcess);
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
183 }
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
184 else
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
185 goto error;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
186 return (int) ret_code;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
187
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
188 error:
321
19dcec799385 Import from CVS: tag r21-0-58
cvs
parents: 290
diff changeset
189 MessageBox (NULL, "Could not start XEmacs or gnuclient.", "Error", MB_ICONSTOP);
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
190 return 1;
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 100
diff changeset
191 }