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