annotate nt/addpm.c @ 13230:ad1d4be6bb8d libc-951018 libc-951029 libc-951031 libc-951101 libc-951102 libc-951103 libc-951104 libc-951105 libc-951106 libc-951107 libc-951108 libc-951109 libc-951110 libc-951111 libc-951112 libc-951113 libc-951114 libc-951115 libc-951116 libc-951117 libc-951118 libc-951119 libc-951120 libc-951121 libc-951122 libc-951123 libc-951124 libc-951125 libc-951126 libc-951127 libc-951128 libc-951129 libc-951130

* config.guess: Recognize HP model 819 machines has having a PA 1.1 processor.
author Jeff Law <law@redhat.com>
date Mon, 16 Oct 1995 15:40:29 +0000
parents e97b20222345
children 705eb8c3d935
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12181
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1 /* Add entries to the GNU Emacs Program Manager folder.
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2 Copyright (C) 1995 Free Software Foundation, Inc.
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4 This file is part of GNU Emacs.
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
5
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
6 GNU Emacs is free software; you can redistribute it and/or modify it
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any later
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
9 version.
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
10
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
11 GNU Emacs is distributed in the hope that it will be useful, but WITHOUT
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
14 more details.
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
15
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License along
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
17 with GNU Emacs; see the file COPYING. If not, write to the Free Software
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
18 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
19 */
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
20
12329
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
21 /****************************************************************************
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
22 *
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
23 * Program: addpm (adds emacs to the Windows program manager)
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
24 *
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
25 * Usage:
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
26 * argv[1] = full path to program to execute
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
27 * argv[2] = full path to icon for emacs (optional)
12181
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
28 */
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
29
12329
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
30 #include <windows.h>
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
31 #include <ddeml.h>
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
32 #include <stdlib.h>
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
33 #include <stdio.h>
12181
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
34
12329
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
35 HDDEDATA CALLBACK DdeCallback (UINT uType, UINT uFmt, HCONV hconv,
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
36 HSZ hsz1, HSZ hsz2, HDDEDATA hdata,
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
37 DWORD dwData1, DWORD dwData2)
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
38 {
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
39 return ((HDDEDATA)NULL);
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
40 }
12181
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
41
12329
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
42 #define DdeCommand(str) \
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
43 DdeClientTransaction (str, strlen(str)+1, HConversation, (HSZ)NULL, \
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
44 CF_TEXT, XTYP_EXECUTE, 30000, NULL)
12181
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
45
12329
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
46 main (argc, argv)
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
47 int argc;
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
48 char *argv[];
12181
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
49 {
12329
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
50 DWORD idDde;
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
51 HCONV HConversation;
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
52 HSZ ProgMan;
12181
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
53 char additem[MAX_PATH*2 + 100];
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
54
12329
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
55 if (argc < 2 || argc > 3)
12181
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
56 {
12329
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
57 fprintf(stderr, "usage: addpm exe_path [icon_path]\n");
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
58 exit(1);
12181
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
59 }
12329
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
60
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
61 DdeInitialize (&idDde, (PFNCALLBACK)DdeCallback, APPCMD_CLIENTONLY, 0);
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
62
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
63 ProgMan = DdeCreateStringHandle (idDde, "PROGMAN", CP_WINANSI);
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
64
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
65 if (HConversation = DdeConnect (idDde, ProgMan, ProgMan, NULL))
12181
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
66 {
12329
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
67 DdeCommand ("[CreateGroup(Gnu Emacs)]");
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
68 DdeCommand ("[ReplaceItem(Emacs)]");
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
69 sprintf (additem, "[AddItem(%s,Emacs%c%s)]",
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
70 argv[1], (argc>2 ? ',' : ' '),
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
71 (argc>2 ? argv[2] : ""));
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
72 DdeCommand (additem);
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
73
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
74 DdeDisconnect (HConversation);
12181
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
75 }
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
76
12329
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
77 DdeFreeStringHandle (idDde, ProgMan);
12181
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
78
12329
e97b20222345 Mostly rewritten.
Richard M. Stallman <rms@gnu.org>
parents: 12181
diff changeset
79 DdeUninitialize (idDde);
12181
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
80
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
81 return (0);
702f2ac242de Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
82 }