1 | #define INCL_DOS
|
---|
2 | #define INCL_WIN
|
---|
3 |
|
---|
4 | #include <os2.h>
|
---|
5 | #include <stdlib.h>
|
---|
6 | #include <stdio.h>
|
---|
7 | #include <string.h>
|
---|
8 | #include "fm3dll.h"
|
---|
9 | #include "fm3dlg.h"
|
---|
10 | #include "fm3str.h"
|
---|
11 |
|
---|
12 | #pragma data_seg(DATA1)
|
---|
13 | #pragma alloc_text(SEEFILES,DoADir,FillListBox,DrvsWndProc,SeeWndProc,EmptyListBox)
|
---|
14 |
|
---|
15 | static HWND amup = (HWND)0;
|
---|
16 | static CHAR stopflag;
|
---|
17 | static CHAR drvsflags[26] = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
|
---|
18 | static INT Sorttype = SORT_FILENAME;
|
---|
19 |
|
---|
20 |
|
---|
21 | static VOID DoADir (HWND hwndList,CHAR *pathname,INT sorttype) {
|
---|
22 |
|
---|
23 | CHAR *filename,*enddir,*temp,*build;
|
---|
24 | FILEFINDBUF3 ffb;
|
---|
25 | HDIR hdir = HDIR_CREATE;
|
---|
26 | ULONG nm = 1L;
|
---|
27 | SHORT sSelect;
|
---|
28 |
|
---|
29 | filename = malloc(CCHMAXPATH);
|
---|
30 | if(!filename)
|
---|
31 | return;
|
---|
32 | build = malloc(CCHMAXPATHCOMP + 34);
|
---|
33 | if(!build) {
|
---|
34 | free(filename);
|
---|
35 | return;
|
---|
36 | }
|
---|
37 | memset(filename,0,CCHMAXPATH);
|
---|
38 | strcpy(filename,pathname);
|
---|
39 | enddir = &filename[strlen(filename) - 1];
|
---|
40 | if(*enddir != '\\') {
|
---|
41 | enddir++;
|
---|
42 | *enddir = '\\';
|
---|
43 | }
|
---|
44 | enddir++;
|
---|
45 | strcpy(enddir,"*");
|
---|
46 | DosError(FERR_DISABLEHARDERR);
|
---|
47 | if(!DosFindFirst(filename,
|
---|
48 | &hdir,
|
---|
49 | FILE_NORMAL | FILE_ARCHIVED | FILE_READONLY |
|
---|
50 | FILE_DIRECTORY,
|
---|
51 | &ffb,
|
---|
52 | sizeof(ffb),
|
---|
53 | &nm,
|
---|
54 | FIL_STANDARD)) {
|
---|
55 | do {
|
---|
56 | priority_normal();
|
---|
57 | if(ffb.attrFile & FILE_DIRECTORY) {
|
---|
58 | if(*ffb.achName != '.' ||
|
---|
59 | (ffb.achName[1] && ffb.achName[1] != '.')) {
|
---|
60 | strcpy(enddir,ffb.achName);
|
---|
61 | DoADir(hwndList,
|
---|
62 | filename,
|
---|
63 | sorttype);
|
---|
64 | }
|
---|
65 | }
|
---|
66 | else {
|
---|
67 | *enddir = 0;
|
---|
68 | switch(sorttype) {
|
---|
69 | case SORT_SIZE:
|
---|
70 | sprintf(build,
|
---|
71 | "%10lu >%s",
|
---|
72 | ffb.cbFile,
|
---|
73 | ffb.achName);
|
---|
74 | break;
|
---|
75 | case SORT_LWDATE:
|
---|
76 | sprintf(build,
|
---|
77 | "%02u:%02u:%02u %04u/%02u/%02u >%s",
|
---|
78 | ffb.ftimeLastWrite.hours,
|
---|
79 | ffb.ftimeLastWrite.minutes,
|
---|
80 | ffb.ftimeLastWrite.twosecs * 2,
|
---|
81 | ffb.fdateLastWrite.year,
|
---|
82 | ffb.fdateLastWrite.month,
|
---|
83 | ffb.fdateLastWrite.day,
|
---|
84 | ffb.achName);
|
---|
85 | break;
|
---|
86 | default:
|
---|
87 | strcpy(build,ffb.achName);
|
---|
88 | break;
|
---|
89 | }
|
---|
90 | sSelect = (SHORT)WinSendMsg(hwndList,
|
---|
91 | LM_INSERTITEM,
|
---|
92 | MPFROMSHORT(LIT_SORTASCENDING),
|
---|
93 | MPFROMP(build));
|
---|
94 | if(sSelect >= 0) {
|
---|
95 | temp = strdup(filename);
|
---|
96 | if(temp) {
|
---|
97 | WinSendMsg(hwndList,
|
---|
98 | LM_SETITEMHANDLE,
|
---|
99 | MPFROMSHORT(sSelect),
|
---|
100 | MPFROMLONG((LONG)temp));
|
---|
101 | DosSleep(0L);
|
---|
102 | }
|
---|
103 | else {
|
---|
104 | WinSendMsg(hwndList,LM_DELETEITEM,MPFROMSHORT(sSelect),MPVOID);
|
---|
105 | saymsg(MB_ENTER | MB_ICONEXCLAMATION,
|
---|
106 | hwndList,
|
---|
107 | GetPString(IDS_ERRORTEXT),
|
---|
108 | GetPString(IDS_OUTOFMEMORY));
|
---|
109 | DosBeep(250,100);
|
---|
110 | stopflag = 1;
|
---|
111 | break;
|
---|
112 | }
|
---|
113 | }
|
---|
114 | else {
|
---|
115 | WinSendMsg(hwndList,
|
---|
116 | LM_DELETEITEM,
|
---|
117 | MPFROMSHORT(sSelect),
|
---|
118 | MPVOID);
|
---|
119 | stopflag = 1;
|
---|
120 | saymsg(MB_ENTER | MB_ICONEXCLAMATION,
|
---|
121 | hwndList,
|
---|
122 | GetPString(IDS_PMLIMITTEXT),
|
---|
123 | GetPString(IDS_NOMOREFILESINLISTBOXTEXT));
|
---|
124 | break;
|
---|
125 | }
|
---|
126 | }
|
---|
127 | nm = 1L;
|
---|
128 | } while(!stopflag &&
|
---|
129 | !DosFindNext(hdir,
|
---|
130 | &ffb,
|
---|
131 | sizeof(ffb),
|
---|
132 | &nm));
|
---|
133 | DosFindClose(hdir);
|
---|
134 | priority_normal();
|
---|
135 | }
|
---|
136 | DosSleep(1L);
|
---|
137 | free(filename);
|
---|
138 | free(build);
|
---|
139 | }
|
---|
140 |
|
---|
141 |
|
---|
142 |
|
---|
143 | static VOID FillListBox (VOID *args) {
|
---|
144 |
|
---|
145 | ULONG ulDriveNum,ulDriveMap,x;
|
---|
146 | CHAR startname[] = " :\\";
|
---|
147 | HWND hwnd,hwndList;
|
---|
148 | HAB hab2;
|
---|
149 | HMQ hmq2;
|
---|
150 |
|
---|
151 | hwnd = (HWND)args;
|
---|
152 | hab2 = WinInitialize(0);
|
---|
153 | if(hab2) {
|
---|
154 | hmq2 = WinCreateMsgQueue(hab2,0);
|
---|
155 | if(hmq2) {
|
---|
156 | WinCancelShutdown(hmq2,TRUE);
|
---|
157 | hwndList = WinWindowFromID(hwnd,SEEF_LISTBOX);
|
---|
158 | priority_normal();
|
---|
159 | DosError(FERR_DISABLEHARDERR);
|
---|
160 | if(!DosQCurDisk(&ulDriveNum,&ulDriveMap)) {
|
---|
161 | for(x = 2L;x < 26L && !stopflag;x++) {
|
---|
162 | if((ulDriveMap & (1L << x)) && drvsflags[x]) {
|
---|
163 | *startname = (CHAR)(x + 'A');
|
---|
164 | DoADir(hwndList,startname,Sorttype);
|
---|
165 | WinSetDlgItemText(hwnd,
|
---|
166 | SEEF_TOTAL,
|
---|
167 | NullStr);
|
---|
168 | {
|
---|
169 | SHORT sTotal;
|
---|
170 | CHAR s[33];
|
---|
171 |
|
---|
172 | sTotal = (SHORT)WinSendDlgItemMsg(hwnd,
|
---|
173 | SEEF_LISTBOX,
|
---|
174 | LM_QUERYITEMCOUNT,
|
---|
175 | MPVOID,
|
---|
176 | MPVOID);
|
---|
177 | if(sTotal >= 0) {
|
---|
178 | sprintf(s,
|
---|
179 | "%u",
|
---|
180 | sTotal);
|
---|
181 | WinSetDlgItemText(hwnd,
|
---|
182 | SEEF_TOTAL,
|
---|
183 | s);
|
---|
184 | }
|
---|
185 | }
|
---|
186 | }
|
---|
187 | }
|
---|
188 | }
|
---|
189 | priority_bumped();
|
---|
190 | WinDestroyMsgQueue(hmq2);
|
---|
191 | }
|
---|
192 | WinTerminate(hab2);
|
---|
193 | }
|
---|
194 | PostMsg(hwnd,UM_CONTAINER_FILLED,MPVOID,MPVOID);
|
---|
195 | }
|
---|
196 |
|
---|
197 |
|
---|
198 | static VOID EmptyListBox (VOID *args) {
|
---|
199 |
|
---|
200 | HWND hwnd,hwndList;
|
---|
201 | HAB hab2;
|
---|
202 | HMQ hmq2;
|
---|
203 |
|
---|
204 | hwnd = (HWND)args;
|
---|
205 | hab2 = WinInitialize(0);
|
---|
206 | if(hab2) {
|
---|
207 | hmq2 = WinCreateMsgQueue(hab2,0);
|
---|
208 | if(hmq2) {
|
---|
209 | WinCancelShutdown(hmq2,TRUE);
|
---|
210 | hwndList = WinWindowFromID(hwnd,SEEF_LISTBOX);
|
---|
211 | priority_normal();
|
---|
212 | DosError(FERR_DISABLEHARDERR);
|
---|
213 | {
|
---|
214 | SHORT sTotal,sSelect = 0;
|
---|
215 | CHAR *dir;
|
---|
216 |
|
---|
217 | DosSleep(128L);
|
---|
218 | sTotal = (SHORT)WinSendMsg(hwndList,LM_QUERYITEMCOUNT,MPVOID,MPVOID);
|
---|
219 | while(sSelect < sTotal) {
|
---|
220 | dir = (CHAR *)WinSendMsg(hwndList,LM_QUERYITEMHANDLE,
|
---|
221 | MPFROM2SHORT(sSelect,0),MPVOID);
|
---|
222 | if(dir)
|
---|
223 | free(dir);
|
---|
224 | sSelect++;
|
---|
225 | DosSleep(0L);
|
---|
226 | }
|
---|
227 | DosSleep(128L);
|
---|
228 | sTotal = (SHORT)WinSendMsg(hwndList,LM_QUERYITEMCOUNT,MPVOID,MPVOID);
|
---|
229 | while(sSelect < sTotal) {
|
---|
230 | dir = (CHAR *)WinSendMsg(hwndList,LM_QUERYITEMHANDLE,
|
---|
231 | MPFROM2SHORT(sSelect,0),MPVOID);
|
---|
232 | if(dir)
|
---|
233 | free(dir);
|
---|
234 | sSelect++;
|
---|
235 | DosSleep(0L);
|
---|
236 | }
|
---|
237 | }
|
---|
238 | priority_bumped();
|
---|
239 | WinDestroyMsgQueue(hmq2);
|
---|
240 | }
|
---|
241 | WinTerminate(hab2);
|
---|
242 | }
|
---|
243 | DosSleep(1L);
|
---|
244 | PostMsg(hwnd,WM_CLOSE,MPVOID,MPVOID);
|
---|
245 | }
|
---|
246 |
|
---|
247 |
|
---|
248 | MRESULT EXPENTRY DrvsWndProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) {
|
---|
249 |
|
---|
250 | switch(msg) {
|
---|
251 | case WM_INITDLG:
|
---|
252 | {
|
---|
253 | ULONG ulDriveNum,ulDriveMap,x;
|
---|
254 | CHAR startname[] = " :";
|
---|
255 | SHORT sSelect;
|
---|
256 |
|
---|
257 | DosError(FERR_DISABLEHARDERR);
|
---|
258 | if(!DosQCurDisk(&ulDriveNum,&ulDriveMap)) {
|
---|
259 | for(x = 2L;x < 26L && !stopflag;x++) {
|
---|
260 | if(!(driveflags[x] & (DRIVE_IGNORE | DRIVE_INVALID))) {
|
---|
261 | if(ulDriveMap & (1L << x)) {
|
---|
262 | *startname = (CHAR)(x + 'A');
|
---|
263 | sSelect = (SHORT)WinSendDlgItemMsg(hwnd,DRVS_LISTBOX,
|
---|
264 | LM_INSERTITEM,
|
---|
265 | MPFROM2SHORT(LIT_END,0),
|
---|
266 | MPFROMP(startname));
|
---|
267 | if(sSelect >= 0 && drvsflags[x])
|
---|
268 | WinSendDlgItemMsg(hwnd,DRVS_LISTBOX,LM_SELECTITEM,
|
---|
269 | MPFROM2SHORT(sSelect,0),MPFROMLONG(TRUE));
|
---|
270 | }
|
---|
271 | }
|
---|
272 | }
|
---|
273 | }
|
---|
274 | }
|
---|
275 | WinCheckButton(hwnd,DRVS_BYNAME,TRUE);
|
---|
276 | break;
|
---|
277 |
|
---|
278 | case WM_COMMAND:
|
---|
279 | switch(SHORT1FROMMP(mp1)) {
|
---|
280 | case DID_OK:
|
---|
281 | {
|
---|
282 | INT x;
|
---|
283 | SHORT sSelect;
|
---|
284 | CHAR filename[3];
|
---|
285 |
|
---|
286 | Sorttype = SORT_FILENAME;
|
---|
287 | if(WinQueryButtonCheckstate(hwnd,DRVS_BYSIZE))
|
---|
288 | Sorttype = SORT_SIZE;
|
---|
289 | else if(WinQueryButtonCheckstate(hwnd,DRVS_BYDATE))
|
---|
290 | Sorttype = SORT_LWDATE;
|
---|
291 | memset(drvsflags,0,sizeof(drvsflags));
|
---|
292 | sSelect = (SHORT)WinSendDlgItemMsg(hwnd,DRVS_LISTBOX,
|
---|
293 | LM_QUERYSELECTION,
|
---|
294 | MPFROM2SHORT(LIT_FIRST,0),
|
---|
295 | MPVOID);
|
---|
296 | while(sSelect >= 0) {
|
---|
297 | *filename = 0;
|
---|
298 | if(WinSendDlgItemMsg(hwnd,DRVS_LISTBOX,LM_QUERYITEMTEXT,
|
---|
299 | MPFROM2SHORT(sSelect,2),
|
---|
300 | MPFROMP(filename)) && *filename)
|
---|
301 | drvsflags[*filename - 'A'] = 1;
|
---|
302 | sSelect = (SHORT)WinSendDlgItemMsg(hwnd,DRVS_LISTBOX,
|
---|
303 | LM_QUERYSELECTION,
|
---|
304 | MPFROM2SHORT(sSelect,0),
|
---|
305 | MPVOID);
|
---|
306 | }
|
---|
307 | for(x = 2L;x < 26L;x++) {
|
---|
308 | if(drvsflags[x]) {
|
---|
309 | WinDismissDlg(hwnd,0);
|
---|
310 | return 0;
|
---|
311 | }
|
---|
312 | }
|
---|
313 | }
|
---|
314 | WinDismissDlg(hwnd,1);
|
---|
315 | break;
|
---|
316 |
|
---|
317 | case IDM_HELP:
|
---|
318 | if(hwndHelp)
|
---|
319 | WinSendMsg(hwndHelp,HM_DISPLAY_HELP,
|
---|
320 | MPFROM2SHORT(HELP_DRVSWND,0),
|
---|
321 | MPFROMSHORT(HM_RESOURCEID));
|
---|
322 | break;
|
---|
323 |
|
---|
324 | case DID_CANCEL:
|
---|
325 | WinDismissDlg(hwnd,1);
|
---|
326 | break;
|
---|
327 | }
|
---|
328 | return 0;
|
---|
329 | }
|
---|
330 | return WinDefDlgProc(hwnd,msg,mp1,mp2);
|
---|
331 | }
|
---|
332 |
|
---|
333 |
|
---|
334 | MRESULT EXPENTRY SeeWndProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) {
|
---|
335 |
|
---|
336 | static HWND hwndParent;
|
---|
337 |
|
---|
338 | switch(msg) {
|
---|
339 | case WM_INITDLG:
|
---|
340 | if(amup || !mp2) {
|
---|
341 | DosBeep(250,100);
|
---|
342 | WinSetWindowPos(amup,HWND_TOP,0,0,0,0,SWP_SHOW | SWP_RESTORE |
|
---|
343 | SWP_ZORDER | SWP_ACTIVATE);
|
---|
344 | WinDismissDlg(hwnd,0);
|
---|
345 | break;
|
---|
346 | }
|
---|
347 | hwndParent = *(HWND *)mp2;
|
---|
348 | amup = hwnd;
|
---|
349 | stopflag = 0;
|
---|
350 | if(WinDlgBox(HWND_DESKTOP,(hwndMain) ? hwndParent : hwndMain,
|
---|
351 | DrvsWndProc,FM3ModHandle,DRVS_FRAME,MPVOID)) {
|
---|
352 | amup = (HWND)0;
|
---|
353 | WinDismissDlg(hwnd,0);
|
---|
354 | }
|
---|
355 | else {
|
---|
356 | if(_beginthread(FillListBox,NULL,524288,(PVOID)hwnd) == -1) {
|
---|
357 | amup = (HWND)0;
|
---|
358 | WinDismissDlg(hwnd,0);
|
---|
359 | }
|
---|
360 | }
|
---|
361 | break;
|
---|
362 |
|
---|
363 | case WM_ADJUSTWINDOWPOS:
|
---|
364 | PostMsg(hwnd,UM_SETDIR,MPVOID,MPVOID);
|
---|
365 | break;
|
---|
366 |
|
---|
367 | case UM_SETDIR:
|
---|
368 | PaintRecessedWindow(WinWindowFromID(hwnd,SEEF_DIR),(HPS)0,FALSE,TRUE);
|
---|
369 | return 0;
|
---|
370 |
|
---|
371 | case UM_CONTAINER_FILLED:
|
---|
372 | WinSetDlgItemText(hwnd,
|
---|
373 | SEEF_TOTAL,
|
---|
374 | NullStr);
|
---|
375 | {
|
---|
376 | SHORT sTotal;
|
---|
377 | CHAR s[33];
|
---|
378 |
|
---|
379 | sTotal = (SHORT)WinSendDlgItemMsg(hwnd,
|
---|
380 | SEEF_LISTBOX,
|
---|
381 | LM_QUERYITEMCOUNT,
|
---|
382 | MPVOID,
|
---|
383 | MPVOID);
|
---|
384 | if(sTotal >= 0) {
|
---|
385 | sprintf(s,
|
---|
386 | "%u",
|
---|
387 | sTotal);
|
---|
388 | WinSetDlgItemText(hwnd,
|
---|
389 | SEEF_TOTAL,
|
---|
390 | s);
|
---|
391 | }
|
---|
392 | }
|
---|
393 | return 0;
|
---|
394 |
|
---|
395 | case WM_CONTROL:
|
---|
396 | switch(SHORT1FROMMP(mp1)) {
|
---|
397 | case SEEF_LISTBOX:
|
---|
398 | switch(SHORT2FROMMP(mp1)) {
|
---|
399 | case LN_ENTER:
|
---|
400 | case LN_SELECT:
|
---|
401 | {
|
---|
402 | CHAR *dir,filename[CCHMAXPATH],*p,*f;
|
---|
403 | SHORT sSelect;
|
---|
404 |
|
---|
405 | sSelect = (SHORT)WinSendDlgItemMsg(hwnd,
|
---|
406 | SEEF_LISTBOX,
|
---|
407 | LM_QUERYSELECTION,
|
---|
408 | MPFROM2SHORT(LIT_FIRST,0),
|
---|
409 | MPVOID);
|
---|
410 | if(sSelect >= 0) {
|
---|
411 | dir = WinSendDlgItemMsg(hwnd,
|
---|
412 | SEEF_LISTBOX,
|
---|
413 | LM_QUERYITEMHANDLE,
|
---|
414 | MPFROM2SHORT(sSelect,0),
|
---|
415 | MPVOID);
|
---|
416 | if(dir) {
|
---|
417 | switch(SHORT2FROMMP(mp1)) {
|
---|
418 | case LN_SELECT:
|
---|
419 | WinSetDlgItemText(hwnd,SEEF_DIR,dir);
|
---|
420 | break;
|
---|
421 | case LN_ENTER:
|
---|
422 | *filename = 0;
|
---|
423 | if(WinSendDlgItemMsg(hwnd,SEEF_LISTBOX,
|
---|
424 | LM_QUERYITEMTEXT,
|
---|
425 | MPFROM2SHORT(sSelect,CCHMAXPATH),
|
---|
426 | MPFROMP(filename)) &&
|
---|
427 | *filename) {
|
---|
428 | f = strchr(filename,'>');
|
---|
429 | if(!f)
|
---|
430 | f = filename;
|
---|
431 | else
|
---|
432 | f++;
|
---|
433 | p = malloc(strlen(dir) + strlen(f) + 1);
|
---|
434 | if(p) {
|
---|
435 | sprintf(p,
|
---|
436 | "%s%s",
|
---|
437 | dir,
|
---|
438 | f);
|
---|
439 | if(!PostMsg(hwnd,
|
---|
440 | WM_COMMAND,
|
---|
441 | MPFROM2SHORT(IDM_COLLECT,0),
|
---|
442 | MPFROMP(p)))
|
---|
443 | free(p);
|
---|
444 | }
|
---|
445 | }
|
---|
446 | break;
|
---|
447 | }
|
---|
448 | }
|
---|
449 | }
|
---|
450 | }
|
---|
451 | break;
|
---|
452 | }
|
---|
453 | return 0;
|
---|
454 | }
|
---|
455 | return 0;
|
---|
456 |
|
---|
457 | case WM_COMMAND:
|
---|
458 | switch(SHORT1FROMMP(mp1)) {
|
---|
459 | case IDM_COLLECT:
|
---|
460 | if(!mp2)
|
---|
461 | break;
|
---|
462 | if(!Collector)
|
---|
463 | WinSendMsg(hwndMain,WM_COMMAND,MPFROM2SHORT(IDM_COLLECTOR,0),
|
---|
464 | MPVOID);
|
---|
465 | else
|
---|
466 | WinSetWindowPos(WinQueryWindow(WinQueryWindow(Collector,QW_PARENT),
|
---|
467 | QW_PARENT),HWND_TOP,0,0,0,0,SWP_SHOW |
|
---|
468 | SWP_RESTORE | SWP_ZORDER);
|
---|
469 | if(!PostMsg(hwnd,WM_COMMAND,MPFROM2SHORT(IDM_COLLECTOR,0),mp2))
|
---|
470 | free(mp2);
|
---|
471 | break;
|
---|
472 |
|
---|
473 | case IDM_COLLECTOR:
|
---|
474 | if(!mp2)
|
---|
475 | break;
|
---|
476 | DosSleep(64L);
|
---|
477 | {
|
---|
478 | CHAR **list;
|
---|
479 |
|
---|
480 | list = malloc(sizeof(CHAR *) * 2);
|
---|
481 | if(list) {
|
---|
482 | list[0] = mp2;
|
---|
483 | list[1] = NULL;
|
---|
484 | if(Collector) {
|
---|
485 | if(!PostMsg(Collector,WM_COMMAND,
|
---|
486 | MPFROM2SHORT(IDM_COLLECTOR,0),
|
---|
487 | MPFROMP(list)))
|
---|
488 | FreeList(list);
|
---|
489 | }
|
---|
490 | else
|
---|
491 | FreeList(list);
|
---|
492 | }
|
---|
493 | else
|
---|
494 | free(mp2);
|
---|
495 | }
|
---|
496 | break;
|
---|
497 |
|
---|
498 | case IDM_HELP:
|
---|
499 | if(hwndHelp)
|
---|
500 | WinSendMsg(hwndHelp,HM_DISPLAY_HELP,
|
---|
501 | MPFROM2SHORT(HELP_SEEWND,0),
|
---|
502 | MPFROMSHORT(HM_RESOURCEID));
|
---|
503 | break;
|
---|
504 |
|
---|
505 | case DID_OK:
|
---|
506 | case DID_CANCEL:
|
---|
507 | stopflag = 1;
|
---|
508 | PostMsg(hwnd,
|
---|
509 | UM_CLOSE,
|
---|
510 | MPVOID,
|
---|
511 | MPVOID);
|
---|
512 | break;
|
---|
513 | }
|
---|
514 | return 0;
|
---|
515 |
|
---|
516 | case UM_CLOSE:
|
---|
517 | WinSetWindowPos(hwnd,
|
---|
518 | HWND_BOTTOM,
|
---|
519 | 0,
|
---|
520 | 0,
|
---|
521 | 0,
|
---|
522 | 0,
|
---|
523 | SWP_SIZE | SWP_MOVE |
|
---|
524 | SWP_MINIMIZE | SWP_HIDE) | SWP_ZORDER;
|
---|
525 | _beginthread(EmptyListBox,
|
---|
526 | NULL,
|
---|
527 | 32768,
|
---|
528 | (PVOID)hwnd);
|
---|
529 | return 0;
|
---|
530 |
|
---|
531 | case WM_CLOSE:
|
---|
532 | amup = (HWND)0;
|
---|
533 | break;
|
---|
534 | }
|
---|
535 | return WinDefDlgProc(hwnd,msg,mp1,mp2);
|
---|
536 | }
|
---|
537 |
|
---|