Added -res option to specify resources on winebuild command-line.
[wine] / programs / progman / dialog.c
1 /*
2  * Program Manager
3  *
4  * Copyright 1996 Ulrich Schmid
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include "windows.h"
22 #include "commdlg.h"
23 #include "progman.h"
24 static BOOL    DIALOG_BrowsePrograms(HWND, LPSTR, INT);
25 static BOOL    DIALOG_BrowseSymbols(HWND, LPSTR, INT);
26 static BOOL CALLBACK DIALOG_NEW_DlgProc(HWND, UINT, WPARAM, LPARAM);
27 static BOOL CALLBACK DIALOG_COPY_MOVE_DlgProc(HWND, UINT, WPARAM, LPARAM);
28 static BOOL CALLBACK DIALOG_GROUP_DlgProc(HWND, UINT, WPARAM, LPARAM);
29 static BOOL CALLBACK DIALOG_PROGRAM_DlgProc(HWND, UINT, WPARAM, LPARAM);
30 static BOOL CALLBACK DIALOG_SYMBOL_DlgProc(HWND, UINT, WPARAM, LPARAM);
31 static BOOL CALLBACK DIALOG_EXECUTE_DlgProc(HWND, UINT, WPARAM, LPARAM);
32
33 /***********************************************************************
34  *
35  *           DIALOG_New
36  */
37
38 static struct
39 {
40   INT nDefault;
41 } New;
42
43 INT DIALOG_New(INT nDefault)
44 {
45   DLGPROC lpfnDlg = MakeProcInstance(DIALOG_NEW_DlgProc, Globals.hInstance);
46   INT ret;
47
48   New.nDefault = nDefault;
49
50   ret = DialogBox(Globals.hInstance,  STRING_NEW_Xx,
51                   Globals.hMainWnd, lpfnDlg);
52   FreeProcInstance(lpfnDlg);
53   return ret;
54 }
55
56 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
57  *
58  *           DIALOG_NEW_DlgProc
59  */
60
61 static BOOL CALLBACK DIALOG_NEW_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
62 {
63   switch (msg)
64     {
65     case WM_INITDIALOG:
66       CheckRadioButton(hDlg, PM_NEW_GROUP, PM_NEW_PROGRAM, New.nDefault);
67       break;
68
69     case WM_COMMAND:
70       switch (wParam)
71         {
72         case PM_NEW_GROUP:
73         case PM_NEW_PROGRAM:
74           CheckRadioButton(hDlg, PM_NEW_GROUP, PM_NEW_PROGRAM, wParam);
75           return TRUE;
76
77         case IDOK:
78           EndDialog(hDlg, IsDlgButtonChecked(hDlg, PM_NEW_GROUP) ?
79                     PM_NEW_GROUP : PM_NEW_PROGRAM);
80           return TRUE;
81
82         case IDCANCEL:
83           EndDialog(hDlg, IDCANCEL);
84           return TRUE;
85         }
86     }
87   return FALSE;
88 }
89
90 /***********************************************************************
91  *
92  *           DIALOG_CopyMove
93  */
94
95 static struct
96 {
97   LPCSTR lpszProgramName, lpszFromGroupName;
98   HLOCAL hToGroup;
99 } CopyMove;
100
101 HLOCAL DIALOG_CopyMove(LPCSTR lpszProgramName, LPCSTR lpszFromGroupName,
102                      BOOL bMove)
103 {
104   DLGPROC lpfnDlg = MakeProcInstance(DIALOG_COPY_MOVE_DlgProc, Globals.hInstance);
105   INT ret;
106
107   CopyMove.lpszProgramName   = lpszProgramName;
108   CopyMove.lpszFromGroupName = lpszFromGroupName;
109   CopyMove.hToGroup          = 0;
110
111   ret = DialogBox(Globals.hInstance,
112                   bMove ? STRING_MOVE_Xx : STRING_COPY_Xx,
113                   Globals.hMainWnd, lpfnDlg);
114   FreeProcInstance(lpfnDlg);
115
116   return((ret == IDOK) ? CopyMove.hToGroup : 0);
117 }
118
119 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
120  *
121  *           DIALOG_COPY_MOVE_DlgProc
122  */
123
124 static BOOL CALLBACK DIALOG_COPY_MOVE_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
125 {
126   HLOCAL hGroup;
127
128   switch (msg)
129     {
130     case WM_INITDIALOG:
131       /* List all group names */
132       for (hGroup = GROUP_FirstGroup(); hGroup; hGroup = GROUP_NextGroup(hGroup))
133         SendDlgItemMessage(hDlg, PM_TO_GROUP, CB_ADDSTRING, 0,
134                            (LPARAM) GROUP_GroupName(hGroup));
135
136       SetDlgItemText(hDlg, PM_PROGRAM,    (LPSTR)CopyMove.lpszProgramName);
137       SetDlgItemText(hDlg, PM_FROM_GROUP, (LPSTR)CopyMove.lpszFromGroupName);
138       break;
139
140     case WM_COMMAND:
141       switch (wParam)
142         {
143         case IDOK:
144         {
145           /* Get selected group */
146           INT nCurSel    = SendDlgItemMessage(hDlg, PM_TO_GROUP, CB_GETCURSEL, 0, 0);
147           INT nLen       = SendDlgItemMessage(hDlg, PM_TO_GROUP, CB_GETLBTEXTLEN, nCurSel, 0);
148           HLOCAL hBuffer = LocalAlloc(LMEM_FIXED, nLen + 1);
149           LPSTR   buffer = LocalLock(hBuffer);
150
151           SendDlgItemMessage(hDlg, PM_TO_GROUP, CB_GETLBTEXT, nCurSel, (LPARAM)buffer);
152           for (hGroup = GROUP_FirstGroup(); hGroup; hGroup = GROUP_NextGroup(hGroup))
153             if (!lstrcmp(buffer, GROUP_GroupName(hGroup))) break;
154           LocalFree(hBuffer);
155
156           CopyMove.hToGroup = hGroup;
157           EndDialog(hDlg, IDOK);
158           return TRUE;
159         }
160
161         case IDCANCEL:
162           EndDialog(hDlg, IDCANCEL);
163           return TRUE;
164         }
165     }
166   return FALSE;
167 }
168
169 /***********************************************************************
170  *
171  *           DIALOG_Delete
172  */
173
174 BOOL DIALOG_Delete(UINT ids_text_s, LPCSTR lpszName)
175 {
176   return (IDYES == MAIN_MessageBoxIDS_s(ids_text_s, lpszName, IDS_DELETE,
177                                         MB_YESNO | MB_DEFBUTTON2));
178 }
179
180
181 /***********************************************************************
182  *
183  *           DIALOG_GroupAttributes
184  */
185
186 static struct
187 {
188   LPSTR lpszTitle, lpszGrpFile;
189   INT   nSize;
190 } GroupAttributes;
191
192 BOOL DIALOG_GroupAttributes(LPSTR lpszTitle, LPSTR lpszGrpFile, INT nSize)
193 {
194   DLGPROC lpfnDlg = MakeProcInstance(DIALOG_GROUP_DlgProc, Globals.hInstance);
195   INT ret;
196
197   GroupAttributes.nSize       = nSize;
198   GroupAttributes.lpszTitle   = lpszTitle;
199   GroupAttributes.lpszGrpFile = lpszGrpFile;
200
201   ret = DialogBox(Globals.hInstance,  STRING_GROUP_Xx,
202                   Globals.hMainWnd, lpfnDlg);
203   FreeProcInstance(lpfnDlg);
204   return(ret == IDOK);
205 }
206
207 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
208  *
209  *           DIALOG_GROUP_DlgProc
210  */
211
212 static BOOL CALLBACK DIALOG_GROUP_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
213 {
214   switch (msg)
215     {
216     case WM_INITDIALOG:
217       SetDlgItemText(hDlg, PM_DESCRIPTION, GroupAttributes.lpszTitle);
218       SetDlgItemText(hDlg, PM_FILE, GroupAttributes.lpszGrpFile);
219       break;
220
221     case WM_COMMAND:
222       switch (wParam)
223         {
224         case IDOK:
225           GetDlgItemText(hDlg, PM_DESCRIPTION, GroupAttributes.lpszTitle,
226                          GroupAttributes.nSize);
227           GetDlgItemText(hDlg, PM_FILE, GroupAttributes.lpszGrpFile,
228                          GroupAttributes.nSize);
229           EndDialog(hDlg, IDOK);
230           return TRUE;
231
232         case IDCANCEL:
233           EndDialog(hDlg, IDCANCEL);
234           return TRUE;
235         }
236     }
237   return FALSE;
238 }
239
240 /***********************************************************************
241  *
242  *           DIALOG_ProgramAttributes
243  */
244
245 static struct
246 {
247   LPSTR lpszTitle, lpszCmdLine, lpszWorkDir, lpszIconFile, lpszTmpIconFile;
248   INT   nSize;
249   INT   *lpnCmdShow;
250   INT   *lpnHotKey;
251   HWND  hSelGroupWnd;
252   HICON *lphIcon, hTmpIcon;
253   INT   *lpnIconIndex, nTmpIconIndex;
254 } ProgramAttributes;
255
256 BOOL DIALOG_ProgramAttributes(LPSTR lpszTitle, LPSTR lpszCmdLine,
257                               LPSTR lpszWorkDir, LPSTR lpszIconFile,
258                               HICON *lphIcon, INT *lpnIconIndex,
259                               INT *lpnHotKey, INT *lpnCmdShow, INT nSize)
260 {
261   CHAR szTmpIconFile[MAX_PATHNAME_LEN];
262   DLGPROC lpfnDlg = MakeProcInstance(DIALOG_PROGRAM_DlgProc, Globals.hInstance);
263   INT ret;
264
265   ProgramAttributes.nSize = nSize;
266   ProgramAttributes.lpszTitle = lpszTitle;
267   ProgramAttributes.lpszCmdLine = lpszCmdLine;
268   ProgramAttributes.lpszWorkDir = lpszWorkDir;
269   ProgramAttributes.lpszIconFile = lpszIconFile;
270   ProgramAttributes.lpnCmdShow = lpnCmdShow;
271   ProgramAttributes.lpnHotKey = lpnHotKey;
272   ProgramAttributes.lphIcon = lphIcon;
273   ProgramAttributes.lpnIconIndex = lpnIconIndex;
274
275 #if 0
276   ProgramAttributes.hTmpIcon = 0;
277 #else
278   ProgramAttributes.hTmpIcon = *lphIcon;
279 #endif
280   ProgramAttributes.nTmpIconIndex = *lpnIconIndex;
281   ProgramAttributes.lpszTmpIconFile = szTmpIconFile;
282   lstrcpyn(ProgramAttributes.lpszTmpIconFile, lpszIconFile, MAX_PATHNAME_LEN);
283
284   ret = DialogBox(Globals.hInstance,  STRING_PROGRAM_Xx,
285                   Globals.hMainWnd, lpfnDlg);
286   FreeProcInstance(lpfnDlg);
287
288   return(ret == IDOK);
289 }
290
291 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
292  *
293  *           DIALOG_PROGRAM_DlgProc
294  */
295
296 static BOOL CALLBACK DIALOG_PROGRAM_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
297 {
298   CHAR buffer[MAX_STRING_LEN];
299   switch (msg)
300     {
301     case WM_INITDIALOG:
302       SetDlgItemText(hDlg, PM_DESCRIPTION, ProgramAttributes.lpszTitle);
303       SetDlgItemText(hDlg, PM_COMMAND_LINE, ProgramAttributes.lpszCmdLine);
304       SetDlgItemText(hDlg, PM_DIRECTORY, ProgramAttributes.lpszWorkDir);
305       if (!*ProgramAttributes.lpnHotKey)
306         {
307           LoadString(Globals.hInstance, IDS_NO_HOT_KEY, buffer, sizeof(buffer));
308           SetDlgItemText(hDlg, PM_HOT_KEY, buffer);
309         }
310
311       CheckDlgButton(hDlg, PM_SYMBOL,
312                      (*ProgramAttributes.lpnCmdShow == SW_SHOWMINIMIZED));
313       SendDlgItemMessage(hDlg, PM_ICON, STM_SETICON,
314                          (WPARAM) ProgramAttributes.hTmpIcon, 0);
315       break;
316
317     case WM_COMMAND:
318       switch (wParam)
319         {
320         case PM_SYMBOL:
321           CheckDlgButton(hDlg, PM_SYMBOL, !IsDlgButtonChecked(hDlg, PM_SYMBOL));
322           return TRUE;
323
324         case PM_BROWSE:
325           {
326             CHAR filename[MAX_PATHNAME_LEN];
327             if (DIALOG_BrowsePrograms(hDlg, filename, sizeof(filename)))
328               SetDlgItemText(hDlg, PM_COMMAND_LINE, filename);
329             return TRUE;
330           }
331
332         case PM_OTHER_SYMBOL:
333           {
334             DIALOG_Symbol(&ProgramAttributes.hTmpIcon,
335                           ProgramAttributes.lpszTmpIconFile,
336                           &ProgramAttributes.nTmpIconIndex,
337                           MAX_PATHNAME_LEN);
338
339             SendDlgItemMessage(hDlg, PM_ICON, STM_SETICON,
340                                (WPARAM) ProgramAttributes.hTmpIcon, 0);
341             return TRUE;
342           }
343
344         case IDOK:
345           GetDlgItemText(hDlg, PM_DESCRIPTION,
346                          ProgramAttributes.lpszTitle,
347                          ProgramAttributes.nSize);
348           GetDlgItemText(hDlg, PM_COMMAND_LINE,
349                          ProgramAttributes.lpszCmdLine,
350                          ProgramAttributes.nSize);
351           GetDlgItemText(hDlg, PM_DIRECTORY,
352                          ProgramAttributes.lpszWorkDir,
353                          ProgramAttributes.nSize);
354
355           if (ProgramAttributes.hTmpIcon)
356             {
357 #if 0
358               if (*ProgramAttributes.lphIcon)
359                 DestroyIcon(*ProgramAttributes.lphIcon);
360 #endif
361               *ProgramAttributes.lphIcon = ProgramAttributes.hTmpIcon;
362               *ProgramAttributes.lpnIconIndex = ProgramAttributes.nTmpIconIndex;
363               lstrcpyn(ProgramAttributes.lpszIconFile,
364                        ProgramAttributes.lpszTmpIconFile,
365                        ProgramAttributes.nSize);
366             }
367
368           *ProgramAttributes.lpnCmdShow =
369             IsDlgButtonChecked(hDlg, PM_SYMBOL) ?
370             SW_SHOWMINIMIZED : SW_SHOWNORMAL;
371           EndDialog(hDlg, IDOK);
372           return TRUE;
373
374         case IDCANCEL:
375           EndDialog(hDlg, IDCANCEL);
376           return TRUE;
377         }
378       return FALSE;
379     }
380   return FALSE;
381 }
382
383 /***********************************************************************
384  *
385  *           DIALOG_Symbol
386  */
387
388 static struct
389 {
390   LPSTR  lpszIconFile;
391   INT    nSize;
392   HICON  *lphIcon;
393   INT    *lpnIconIndex;
394 } Symbol;
395
396 VOID DIALOG_Symbol(HICON *lphIcon, LPSTR lpszIconFile,
397                    INT *lpnIconIndex, INT nSize)
398 {
399   DLGPROC lpfnDlg = MakeProcInstance(DIALOG_SYMBOL_DlgProc, Globals.hInstance);
400
401   Symbol.nSize = nSize;
402   Symbol.lpszIconFile = lpszIconFile;
403   Symbol.lphIcon = lphIcon;
404   Symbol.lpnIconIndex = lpnIconIndex;
405
406   DialogBox(Globals.hInstance, STRING_SYMBOL_Xx,
407             Globals.hMainWnd, lpfnDlg);
408   FreeProcInstance(lpfnDlg);
409 }
410
411 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
412  *
413  *           DIALOG_SYMBOL_DlgProc
414  */
415
416 static BOOL CALLBACK DIALOG_SYMBOL_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
417 {
418   switch (msg)
419     {
420     case WM_INITDIALOG:
421       SetDlgItemText(hDlg, PM_ICON_FILE, Symbol.lpszIconFile);
422       SendDlgItemMessage(hDlg, PM_SYMBOL_LIST, CB_SETITEMHEIGHT, 0, (LPARAM) 32);
423       SendDlgItemMessage(hDlg, PM_SYMBOL_LIST, CB_ADDSTRING, 0, (LPARAM)*Symbol.lphIcon);
424       SendDlgItemMessage(hDlg, PM_SYMBOL_LIST, CB_ADDSTRING, 0, (LPARAM)Globals.hDefaultIcon);
425       SendDlgItemMessage(hDlg, PM_SYMBOL_LIST, CB_SETCURSEL, 0, 0);
426       return TRUE;
427
428     case WM_MEASUREITEM:
429       {
430         PMEASUREITEMSTRUCT measure = (PMEASUREITEMSTRUCT) lParam;
431         measure->itemWidth = 32;
432         measure->itemHeight = 32;
433         return TRUE;
434       }
435
436     case WM_DRAWITEM:
437       {
438         PDRAWITEMSTRUCT dis = (PDRAWITEMSTRUCT) lParam;
439         DrawIcon(dis->hDC, dis->rcItem.left, dis->rcItem.top, (HICON)dis->itemData);
440         return TRUE;
441       }
442
443     case WM_COMMAND:
444       switch (wParam)
445         {
446         case PM_BROWSE:
447           {
448             CHAR filename[MAX_PATHNAME_LEN];
449             if (DIALOG_BrowseSymbols(hDlg, filename, sizeof(filename)))
450               SetDlgItemText(hDlg, PM_ICON_FILE, filename);
451             return TRUE;
452           }
453
454         case PM_HELP:
455           MAIN_MessageBoxIDS(IDS_NOT_IMPLEMENTED, IDS_ERROR, MB_OK);
456           return TRUE;
457
458         case IDOK:
459           {
460             INT nCurSel = SendDlgItemMessage(hDlg, PM_SYMBOL_LIST, CB_GETCURSEL, 0, 0);
461
462             GetDlgItemText(hDlg, PM_ICON_FILE, Symbol.lpszIconFile, Symbol.nSize);
463
464             *Symbol.lphIcon = (HICON)SendDlgItemMessage(hDlg, PM_SYMBOL_LIST,
465                                                         CB_GETITEMDATA,
466                                                         (WPARAM) nCurSel, 0);
467 #if 0
468             *Symbol.lphIcon = CopyIcon(*Symbol.lphIcon);
469 #endif
470
471             EndDialog(hDlg, IDOK);
472             return TRUE;
473           }
474
475         case IDCANCEL:
476           EndDialog(hDlg, IDCANCEL);
477           return TRUE;
478         }
479     }
480   return FALSE;
481 }
482
483 /***********************************************************************
484  *
485  *           DIALOG_Execute
486  */
487
488 VOID DIALOG_Execute()
489 {
490   DLGPROC lpfnDlg = MakeProcInstance(DIALOG_EXECUTE_DlgProc, Globals.hInstance);
491   DialogBox(Globals.hInstance, STRING_EXECUTE_Xx,
492             Globals.hMainWnd, lpfnDlg);
493   FreeProcInstance(lpfnDlg);
494 }
495
496 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
497  *
498  *           DIALOG_EXECUTE_DlgProc
499  */
500
501 static BOOL CALLBACK DIALOG_EXECUTE_DlgProc(HWND hDlg, UINT msg,
502                                       WPARAM wParam, LPARAM lParam)
503 {
504   switch (msg)
505     {
506     case WM_COMMAND:
507       switch (wParam)
508         {
509         case PM_SYMBOL:
510           CheckDlgButton(hDlg, PM_SYMBOL, !IsDlgButtonChecked(hDlg, PM_SYMBOL));
511           return TRUE;
512
513         case PM_BROWSE:
514           {
515             CHAR filename[MAX_PATHNAME_LEN];
516             if (DIALOG_BrowsePrograms(hDlg, filename, sizeof(filename)))
517               SetDlgItemText(hDlg, PM_COMMAND, filename);
518             return TRUE;
519           }
520
521         case PM_HELP:
522           MAIN_MessageBoxIDS(IDS_NOT_IMPLEMENTED, IDS_ERROR, MB_OK);
523           return TRUE;
524
525         case IDOK:
526           {
527             CHAR cmdline[MAX_PATHNAME_LEN];
528             GetDlgItemText(hDlg, PM_COMMAND, cmdline, sizeof(cmdline));
529
530             WinExec(cmdline, IsDlgButtonChecked(hDlg, PM_SYMBOL) ?
531                     SW_SHOWMINIMIZED : SW_SHOWNORMAL);
532             if (Globals.bMinOnRun) CloseWindow(Globals.hMainWnd);
533
534             EndDialog(hDlg, IDOK);
535             return TRUE;
536           }
537
538         case IDCANCEL:
539           EndDialog(hDlg, IDCANCEL);
540           return TRUE;
541         }
542     }
543   return FALSE;
544 }
545
546 /***********************************************************************
547  *
548  *           DIALOG_Browse
549  */
550
551 static BOOL DIALOG_Browse(HWND hDlg, LPCSTR lpszzFilter,
552                           LPSTR lpstrFile, INT nMaxFile)
553 {
554   OPENFILENAME openfilename;
555
556   /* FIXME is this correct ? */
557   openfilename.lStructSize       = 0;
558   openfilename.hwndOwner         = hDlg;
559   openfilename.hInstance         = Globals.hInstance;
560   openfilename.lpstrFilter       = (LPSTR)lpszzFilter;
561   openfilename.lpstrCustomFilter = 0;
562   openfilename.nMaxCustFilter    = 0;
563   openfilename.nFilterIndex      = 0;
564   openfilename.lpstrFile         = lpstrFile;
565   openfilename.nMaxFile          = nMaxFile;
566   openfilename.lpstrFileTitle    = 0;
567   openfilename.nMaxFileTitle     = 0;
568   openfilename.lpstrInitialDir   = 0;
569   openfilename.lpstrTitle        = 0;
570   openfilename.Flags             = 0;
571   openfilename.nFileOffset       = 0;
572   openfilename.nFileExtension    = 0;
573   openfilename.lpstrDefExt       = 0;
574   openfilename.lCustData         = 0;
575   openfilename.lpfnHook          = 0;
576   openfilename.lpTemplateName    = 0;
577   return GetOpenFileName(&openfilename);
578 }
579
580 /***********************************************************************
581  *
582  *           DIALOG_AddFilterItem
583  */
584
585 static VOID DIALOG_AddFilterItem(LPSTR *p, UINT ids, LPCSTR filter)
586 {
587   LoadString(Globals.hInstance, ids, *p, MAX_STRING_LEN);
588   *p += strlen(*p) + 1;
589   lstrcpy(*p, filter);
590   *p += strlen(*p) + 1;
591   **p = '\0';
592 }
593
594 /***********************************************************************
595  *
596  *           DIALOG_BrowsePrograms
597  */
598
599 static BOOL DIALOG_BrowsePrograms(HWND hDlg, LPSTR lpszFile, INT nMaxFile)
600 {
601   CHAR  szzFilter[2 * MAX_STRING_LEN + 100];
602   LPSTR p = szzFilter;
603
604   DIALOG_AddFilterItem(&p, IDS_PROGRAMS,  "*.exe;*.pif;*.com;*.bat");
605   DIALOG_AddFilterItem(&p, IDS_ALL_FILES, "*.*");
606
607   return(DIALOG_Browse(hDlg, szzFilter, lpszFile, nMaxFile));
608 }
609
610 /***********************************************************************
611  *
612  *           DIALOG_BrowseSymbols
613  */
614
615 static BOOL DIALOG_BrowseSymbols(HWND hDlg, LPSTR lpszFile, INT nMaxFile)
616 {
617   CHAR  szzFilter[5 * MAX_STRING_LEN + 100];
618   LPSTR p = szzFilter;
619
620   DIALOG_AddFilterItem(&p, IDS_SYMBOL_FILES,  "*.ico;*.exe;*.dll");
621   DIALOG_AddFilterItem(&p, IDS_PROGRAMS,      "*.exe");
622   DIALOG_AddFilterItem(&p, IDS_LIBRARIES_DLL, "*.dll");
623   DIALOG_AddFilterItem(&p, IDS_SYMBOLS_ICO,   "*.ico");
624   DIALOG_AddFilterItem(&p, IDS_ALL_FILES,     "*.*");
625
626   return(DIALOG_Browse(hDlg, szzFilter, lpszFile, nMaxFile));
627 }
628
629 /* Local Variables:    */
630 /* c-file-style: "GNU" */
631 /* End:                */