1 |
|
---|
2 | /***********************************************************************
|
---|
3 |
|
---|
4 | $Id: notify.c 689 2007-06-15 06:33:24Z stevenhl $
|
---|
5 |
|
---|
6 | Notifications
|
---|
7 |
|
---|
8 | Copyright (c) 1993-98 M. Kimes
|
---|
9 | Copyright (c) 2006 Steven H.Levine
|
---|
10 |
|
---|
11 | 17 Jul 06 SHL Use Win_Error
|
---|
12 | 22 Jul 06 SHL Check more run time errors
|
---|
13 | 30 Mar 07 GKY Remove GetPString for window class names
|
---|
14 |
|
---|
15 | ***********************************************************************/
|
---|
16 |
|
---|
17 | #define INCL_DOS
|
---|
18 | #define INCL_WIN
|
---|
19 | #define INCL_GPI
|
---|
20 | #include <os2.h>
|
---|
21 |
|
---|
22 | #include <stdarg.h>
|
---|
23 | #include <stdio.h>
|
---|
24 | #include <stdlib.h>
|
---|
25 | #include <string.h>
|
---|
26 | #include <ctype.h>
|
---|
27 | #include <time.h>
|
---|
28 | #include <stddef.h>
|
---|
29 | #include <process.h> // _beginthread
|
---|
30 |
|
---|
31 | #include "fm3dll.h"
|
---|
32 | #include "fm3dlg.h"
|
---|
33 | #include "fm3str.h"
|
---|
34 |
|
---|
35 | #pragma data_seg(DATA1)
|
---|
36 |
|
---|
37 | static PSZ pszSrcFile = __FILE__;
|
---|
38 |
|
---|
39 | #pragma alloc_text(NOTIFY,Notify,NotifyWndProc,StartNotify)
|
---|
40 | #pragma alloc_text(NOTIFY,NotifyThread,NotifyError)
|
---|
41 | #pragma alloc_text(NOTIFY2,AddNote,NoteThread,NoteWndProc)
|
---|
42 | #pragma alloc_text(NOTIFY3,StartNotes,EndNote,HideNote,ShowNote)
|
---|
43 |
|
---|
44 | static HWND hwndNotify;
|
---|
45 |
|
---|
46 | MRESULT EXPENTRY NotifyWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
47 | {
|
---|
48 | static ULONG showing = 0;
|
---|
49 |
|
---|
50 | switch (msg) {
|
---|
51 | case WM_CREATE:
|
---|
52 | showing++;
|
---|
53 | {
|
---|
54 | MRESULT rc;
|
---|
55 |
|
---|
56 | rc = PFNWPStatic(hwnd, msg, mp1, mp2);
|
---|
57 | if (!WinStartTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_TIMER2, 5000)) {
|
---|
58 | Win_Error(hwnd, hwnd, pszSrcFile, __LINE__, "WinStartTimer");
|
---|
59 | WinDestroyWindow(hwnd);
|
---|
60 | }
|
---|
61 | else {
|
---|
62 |
|
---|
63 | RGB2 rgb2F, rgb2;
|
---|
64 |
|
---|
65 | memset(&rgb2F, 0, sizeof(RGB2));
|
---|
66 | rgb2F.bRed = (BYTE)65;
|
---|
67 | rgb2.bRed = rgb2.bGreen = rgb2.bBlue = (BYTE)255;
|
---|
68 | rgb2.fcOptions = 0;
|
---|
69 | SetPresParams(hwnd, &rgb2, &rgb2F, &rgb2, GetPString(IDS_8HELVTEXT));
|
---|
70 | if (hwndMain) {
|
---|
71 | if (hwndStatus)
|
---|
72 | WinShowWindow(hwndStatus, FALSE);
|
---|
73 | if (hwndStatus2)
|
---|
74 | WinShowWindow(hwndStatus2, FALSE);
|
---|
75 | }
|
---|
76 | PostMsg(hwnd, UM_SETUP, MPVOID, MPVOID);
|
---|
77 | }
|
---|
78 | return rc;
|
---|
79 | }
|
---|
80 |
|
---|
81 | case UM_SETUP:
|
---|
82 | WinSetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_ZORDER | SWP_SHOW);
|
---|
83 | WinInvalidateRect(hwnd, NULL, FALSE);
|
---|
84 | return 0;
|
---|
85 |
|
---|
86 | case WM_SETFOCUS:
|
---|
87 | if (mp2)
|
---|
88 | PostMsg(hwnd, UM_REPLACEFOCUS, mp1, MPVOID);
|
---|
89 | break;
|
---|
90 |
|
---|
91 | case UM_REPLACEFOCUS:
|
---|
92 | if (mp1)
|
---|
93 | WinSetFocus(HWND_DESKTOP, (HWND) mp1);
|
---|
94 | PostMsg(hwnd, UM_SETUP, MPVOID, MPVOID);
|
---|
95 | return 0;
|
---|
96 |
|
---|
97 | case WM_PAINT:
|
---|
98 | {
|
---|
99 | MRESULT mr;
|
---|
100 | HPS hps;
|
---|
101 | SWP swp;
|
---|
102 | POINTL ptl;
|
---|
103 |
|
---|
104 | mr = PFNWPStatic(hwnd, msg, mp1, mp2);
|
---|
105 | hps = WinGetPS(hwnd);
|
---|
106 | if (hps) {
|
---|
107 | if (WinQueryWindowPos(hwnd, &swp)) {
|
---|
108 | ptl.x = 0;
|
---|
109 | ptl.y = 0;
|
---|
110 | GpiMove(hps, &ptl);
|
---|
111 | GpiSetColor(hps, CLR_RED);
|
---|
112 | ptl.x = swp.cx - 1;
|
---|
113 | ptl.y = swp.cy - 1;
|
---|
114 | GpiBox(hps, DRO_OUTLINE, &ptl, 2, 2);
|
---|
115 | }
|
---|
116 | WinReleasePS(hwnd);
|
---|
117 | }
|
---|
118 | return mr;
|
---|
119 | }
|
---|
120 |
|
---|
121 | case WM_BUTTON1DOWN:
|
---|
122 | case WM_BUTTON2DOWN:
|
---|
123 | case WM_BUTTON3DOWN:
|
---|
124 | case WM_TIMER:
|
---|
125 | case WM_CLOSE:
|
---|
126 | WinStopTimer(WinQueryAnchorBlock(hwnd), hwnd, ID_TIMER2);
|
---|
127 | WinDestroyWindow(hwnd);
|
---|
128 | return 0;
|
---|
129 |
|
---|
130 | case WM_DESTROY:
|
---|
131 | showing--;
|
---|
132 | if (!showing && hwndMain) {
|
---|
133 | if (hwndStatus)
|
---|
134 | WinShowWindow(hwndStatus, TRUE);
|
---|
135 | if (hwndStatus2)
|
---|
136 | WinShowWindow(hwndStatus2, TRUE);
|
---|
137 | }
|
---|
138 | break;
|
---|
139 | }
|
---|
140 | return PFNWPStatic(hwnd, msg, mp1, mp2);
|
---|
141 | }
|
---|
142 |
|
---|
143 | HWND DoNotify(char *str)
|
---|
144 | {
|
---|
145 | char *p;
|
---|
146 | HWND hwnd = (HWND) 0, hwndP;
|
---|
147 | LONG x, y, cx, cy;
|
---|
148 | SWP swp, swpS, swpS2;
|
---|
149 | static USHORT id = NOTE_FRAME;
|
---|
150 |
|
---|
151 | if (str && *str) {
|
---|
152 | /* figure out what size the window should be and where it should be */
|
---|
153 | hwndP = (hwndMain) ? WinQueryWindow(hwndMain, QW_PARENT) : HWND_DESKTOP;
|
---|
154 | WinQueryWindowPos(hwndP, &swp);
|
---|
155 | if (hwndStatus)
|
---|
156 | WinQueryWindowPos(hwndStatus, &swpS);
|
---|
157 | if (hwndStatus2)
|
---|
158 | WinQueryWindowPos(hwndStatus2, &swpS2);
|
---|
159 | x = (hwndMain) ? ((hwndStatus) ? swpS.x - 1 :
|
---|
160 | WinQuerySysValue(HWND_DESKTOP, SV_CXSIZEBORDER)) : 0;
|
---|
161 | y = (hwndMain) ? ((hwndStatus) ? swpS.y - 1 :
|
---|
162 | WinQuerySysValue(HWND_DESKTOP, SV_CYSIZEBORDER)) : 0;
|
---|
163 | if (hwndMain && hwndStatus) {
|
---|
164 | if (hwndStatus2)
|
---|
165 | cx = swpS2.cx + swpS.cx + 8;
|
---|
166 | else
|
---|
167 | cx = swpS.cx + 6;
|
---|
168 | }
|
---|
169 | else
|
---|
170 | cx = (swp.cx - ((x * 2) + 4));
|
---|
171 | cy = (hwndMain) ? ((hwndStatus) ? swpS.cy + 2 : 28) : 28;
|
---|
172 |
|
---|
173 | /* pretty-up the note by putting on a leading space */
|
---|
174 | if (*str != ' ') {
|
---|
175 | p = xmalloc(strlen(str) + 2, pszSrcFile, __LINE__);
|
---|
176 | if (!p)
|
---|
177 | p = str;
|
---|
178 | else {
|
---|
179 | strcpy(p + 1, str);
|
---|
180 | *p = ' ';
|
---|
181 | }
|
---|
182 | }
|
---|
183 | else
|
---|
184 | p = str;
|
---|
185 |
|
---|
186 | hwnd = WinCreateWindow(hwndP,
|
---|
187 | WC_ERRORWND,
|
---|
188 | p,
|
---|
189 | SS_TEXT | DT_LEFT | DT_VCENTER | WS_VISIBLE,
|
---|
190 | x, y, cx, cy, hwndP, HWND_TOP, id++, NULL, NULL);
|
---|
191 | if (!hwndP)
|
---|
192 | Win_Error2(hwndP, hwndP, pszSrcFile, __LINE__, IDS_WINCREATEWINDOW);
|
---|
193 |
|
---|
194 | if (p != str)
|
---|
195 | free(p);
|
---|
196 | if (id > NOTE_MAX)
|
---|
197 | id = NOTE_FRAME;
|
---|
198 | }
|
---|
199 |
|
---|
200 | AddNote(str);
|
---|
201 |
|
---|
202 | return hwnd;
|
---|
203 | }
|
---|
204 |
|
---|
205 | HWND Notify(char *str)
|
---|
206 | {
|
---|
207 | return (HWND) WinSendMsg(MainObjectHwnd, UM_NOTIFY, MPFROMP(str), MPVOID);
|
---|
208 | }
|
---|
209 |
|
---|
210 | VOID NotifyError(CHAR * filename, APIRET status)
|
---|
211 | {
|
---|
212 | CHAR errortext[512];
|
---|
213 |
|
---|
214 | if (!filename)
|
---|
215 | return;
|
---|
216 | sprintf(errortext, GetPString(IDS_ERRORACCESSTEXT), status, filename);
|
---|
217 | if (toupper(*filename) > 'B') {
|
---|
218 | if (status == 21)
|
---|
219 | strcat(errortext, GetPString(IDS_EMPTYREMOVETEXT));
|
---|
220 | else if (status == 27)
|
---|
221 | strcat(errortext, GetPString(IDS_CDMUSICTEXT));
|
---|
222 | else if (status == 19)
|
---|
223 | strcat(errortext, GetPString(IDS_WRITEPROTECTTEXT));
|
---|
224 | else if (status == 108)
|
---|
225 | strcat(errortext, GetPString(IDS_DRIVELOCKEDTEXT));
|
---|
226 | }
|
---|
227 | else {
|
---|
228 | if (status == 21)
|
---|
229 | strcat(errortext, GetPString(IDS_EMPTYFLOPPYTEXT));
|
---|
230 | else if (status == 27)
|
---|
231 | strcat(errortext, GetPString(IDS_UNFORMATEDTEXT));
|
---|
232 | else if (status == 107)
|
---|
233 | sprintf(&errortext[strlen(errortext)],
|
---|
234 | GetPString(IDS_PHANTOMTEXT), toupper(*filename));
|
---|
235 | else if (status == 19)
|
---|
236 | strcat(errortext, GetPString(IDS_DISKWRITEPROTEXTTEXT));
|
---|
237 | else if (status == 108)
|
---|
238 | strcat(errortext, GetPString(IDS_DISKLOCKEDTEXT));
|
---|
239 | }
|
---|
240 | DosBeep(250, 10);
|
---|
241 | DosBeep(500, 10);
|
---|
242 | DosBeep(250, 10);
|
---|
243 | DosBeep(500, 10);
|
---|
244 | Notify(errortext);
|
---|
245 | }
|
---|
246 |
|
---|
247 | MRESULT EXPENTRY NoteWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
---|
248 | {
|
---|
249 | static HPOINTER hptrIcon = (HPOINTER) 0;
|
---|
250 |
|
---|
251 | switch (msg) {
|
---|
252 | case WM_INITDLG:
|
---|
253 | if (hwndNotify != (HWND) 0) {
|
---|
254 | if (mp2) {
|
---|
255 | WinSendDlgItemMsg(hwndNotify,
|
---|
256 | NOTE_LISTBOX,
|
---|
257 | LM_INSERTITEM, MPFROM2SHORT(LIT_END, 0), mp2);
|
---|
258 | PostMsg(hwndNotify, UM_NOTIFY, MPVOID, MPVOID);
|
---|
259 | free((CHAR *) mp2);
|
---|
260 | }
|
---|
261 | WinDismissDlg(hwnd, 0);
|
---|
262 | break;
|
---|
263 | }
|
---|
264 | hwndNotify = hwnd;
|
---|
265 | fThreadNotes = FALSE;
|
---|
266 | {
|
---|
267 | BOOL dummy = TRUE;
|
---|
268 |
|
---|
269 | PrfWriteProfileData(fmprof,
|
---|
270 | FM3Str, "ThreadNotes", &dummy, sizeof(BOOL));
|
---|
271 | }
|
---|
272 | if (mp2) {
|
---|
273 | WinSendDlgItemMsg(hwnd,
|
---|
274 | NOTE_LISTBOX,
|
---|
275 | LM_INSERTITEM, MPFROM2SHORT(LIT_END, 0), mp2);
|
---|
276 | free((CHAR *) mp2);
|
---|
277 | }
|
---|
278 | {
|
---|
279 | HWND hwndActive;
|
---|
280 |
|
---|
281 | hwndActive = WinQueryActiveWindow(HWND_DESKTOP);
|
---|
282 | PostMsg(hwnd, UM_FOCUSME, MPFROMLONG(hwndActive), MPVOID);
|
---|
283 | }
|
---|
284 | hptrIcon = WinLoadPointer(HWND_DESKTOP, FM3ModHandle, NOTE_FRAME);
|
---|
285 | if (hptrIcon)
|
---|
286 | WinDefDlgProc(hwnd, WM_SETICON, MPFROMLONG(hptrIcon), MPFROMLONG(0L));
|
---|
287 | break;
|
---|
288 |
|
---|
289 | case UM_FOCUSME:
|
---|
290 | {
|
---|
291 | ULONG size = sizeof(SWP),
|
---|
292 | fl = SWP_ZORDER | SWP_FOCUSDEACTIVATE | SWP_SHOW;
|
---|
293 | SWP swp;
|
---|
294 |
|
---|
295 | if (PrfQueryProfileData(fmprof,
|
---|
296 | FM3Str, "NoteWndSwp", (PVOID) & swp, &size)) {
|
---|
297 | if (swp.fl & (SWP_HIDE | SWP_MINIMIZE)) {
|
---|
298 | fl |= SWP_MINIMIZE;
|
---|
299 | fl &= (~SWP_SHOW);
|
---|
300 | }
|
---|
301 | else
|
---|
302 | fl |= (SWP_MOVE | SWP_SIZE);
|
---|
303 | }
|
---|
304 | WinSetWindowPos(hwnd, HWND_BOTTOM, swp.x, swp.y, swp.cx, swp.cy, fl);
|
---|
305 | if (fl & SWP_MINIMIZE) {
|
---|
306 | WinSetWindowUShort(hwnd, QWS_XRESTORE, (USHORT) swp.x);
|
---|
307 | WinSetWindowUShort(hwnd, QWS_CXRESTORE, (USHORT) swp.cx);
|
---|
308 | WinSetWindowUShort(hwnd, QWS_YRESTORE, (USHORT) swp.y);
|
---|
309 | WinSetWindowUShort(hwnd, QWS_CYRESTORE, (USHORT) swp.cy);
|
---|
310 | }
|
---|
311 | }
|
---|
312 | if (mp1)
|
---|
313 | WinSetActiveWindow(HWND_DESKTOP, (HWND) mp1);
|
---|
314 | return 0;
|
---|
315 |
|
---|
316 | case UM_STRETCH:
|
---|
317 | {
|
---|
318 | SWP swp;
|
---|
319 | LONG titl, szbx, szby;
|
---|
320 |
|
---|
321 | WinQueryWindowPos(hwnd, &swp);
|
---|
322 | if (!(swp.fl & (SWP_MINIMIZE | SWP_HIDE))) {
|
---|
323 | szbx = SysVal(SV_CXSIZEBORDER);
|
---|
324 | szby = SysVal(SV_CYSIZEBORDER);
|
---|
325 | titl = SysVal(SV_CYTITLEBAR);
|
---|
326 | WinSetWindowPos(WinWindowFromID(hwnd, NOTE_LISTBOX),
|
---|
327 | HWND_TOP,
|
---|
328 | szbx,
|
---|
329 | szby,
|
---|
330 | swp.cx - (szbx * 2L),
|
---|
331 | (swp.cy - titl) - (szby * 2L), SWP_MOVE | SWP_SIZE);
|
---|
332 | }
|
---|
333 | if (!(swp.fl & SWP_MAXIMIZE)) {
|
---|
334 | if (swp.fl & (SWP_MINIMIZE | SWP_HIDE)) {
|
---|
335 | swp.x = WinQueryWindowUShort(hwnd, QWS_XRESTORE);
|
---|
336 | swp.y = WinQueryWindowUShort(hwnd, QWS_YRESTORE);
|
---|
337 | swp.cx = WinQueryWindowUShort(hwnd, QWS_CXRESTORE);
|
---|
338 | swp.cy = WinQueryWindowUShort(hwnd, QWS_CYRESTORE);
|
---|
339 | }
|
---|
340 | PrfWriteProfileData(fmprof,
|
---|
341 | FM3Str, "NoteWndSwp", (PVOID) & swp, sizeof(SWP));
|
---|
342 | }
|
---|
343 | }
|
---|
344 | return 0;
|
---|
345 |
|
---|
346 | case WM_ADJUSTWINDOWPOS:
|
---|
347 | PostMsg(hwnd, UM_STRETCH, MPVOID, MPVOID);
|
---|
348 | break;
|
---|
349 |
|
---|
350 | case UM_CONTAINER_FILLED:
|
---|
351 | {
|
---|
352 | SHORT x, y;
|
---|
353 |
|
---|
354 | x = (SHORT) WinSendDlgItemMsg(hwnd,
|
---|
355 | NOTE_LISTBOX,
|
---|
356 | LM_QUERYITEMCOUNT, MPVOID, MPVOID);
|
---|
357 | if (x > 60) {
|
---|
358 | for (y = 0; y < x - 50; y++)
|
---|
359 | WinSendDlgItemMsg(hwnd,
|
---|
360 | NOTE_LISTBOX,
|
---|
361 | LM_DELETEITEM, MPFROMSHORT(y), MPVOID);
|
---|
362 | }
|
---|
363 | }
|
---|
364 | return 0;
|
---|
365 |
|
---|
366 | case UM_NOTIFY:
|
---|
367 | {
|
---|
368 | SHORT x;
|
---|
369 |
|
---|
370 | x = (SHORT) WinSendDlgItemMsg(hwnd,
|
---|
371 | NOTE_LISTBOX,
|
---|
372 | LM_QUERYITEMCOUNT, MPVOID, MPVOID);
|
---|
373 | if (x > 0)
|
---|
374 | WinSendDlgItemMsg(hwnd,
|
---|
375 | NOTE_LISTBOX,
|
---|
376 | LM_SETTOPINDEX, MPFROMSHORT(x), MPVOID);
|
---|
377 | }
|
---|
378 | return 0;
|
---|
379 |
|
---|
380 | case UM_SHOWME:
|
---|
381 | WinSetWindowPos(hwnd,
|
---|
382 | HWND_TOP,
|
---|
383 | 0,
|
---|
384 | 0,
|
---|
385 | 0, 0, SWP_SHOW | SWP_RESTORE | SWP_ZORDER | SWP_ACTIVATE);
|
---|
386 | return 0;
|
---|
387 |
|
---|
388 | case WM_COMMAND:
|
---|
389 | return 0;
|
---|
390 |
|
---|
391 | case WM_CLOSE:
|
---|
392 | WinDismissDlg(hwnd, 0);
|
---|
393 | return 0;
|
---|
394 |
|
---|
395 | case WM_DESTROY:
|
---|
396 | if (hwndNotify == hwnd) {
|
---|
397 | fThreadNotes = FALSE;
|
---|
398 | PrfWriteProfileData(fmprof,
|
---|
399 | FM3Str, "ThreadNotes", &fThreadNotes, sizeof(BOOL));
|
---|
400 | hwndNotify = (HWND) 0;
|
---|
401 | }
|
---|
402 | if (hptrIcon)
|
---|
403 | WinDestroyPointer(hptrIcon);
|
---|
404 | if (!PostMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID))
|
---|
405 | WinSendMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID);
|
---|
406 | break;
|
---|
407 | }
|
---|
408 | return WinDefDlgProc(hwnd, msg, mp1, mp2);
|
---|
409 | }
|
---|
410 |
|
---|
411 | static VOID NoteThread(VOID * args)
|
---|
412 | {
|
---|
413 | HAB hab2;
|
---|
414 | HMQ hmq2;
|
---|
415 |
|
---|
416 | hab2 = WinInitialize(0);
|
---|
417 | if (hab2) {
|
---|
418 | hmq2 = WinCreateMsgQueue(hab2, 0);
|
---|
419 | if (hmq2) {
|
---|
420 | if (!hwndNotify)
|
---|
421 | WinDlgBox(HWND_DESKTOP,
|
---|
422 | HWND_DESKTOP,
|
---|
423 | NoteWndProc, FM3ModHandle, NOTE_FRAME, (CHAR *) args);
|
---|
424 | WinDestroyMsgQueue(hmq2);
|
---|
425 | }
|
---|
426 | WinTerminate(hab2);
|
---|
427 | }
|
---|
428 | }
|
---|
429 |
|
---|
430 | VOID StartNotes(CHAR * note)
|
---|
431 | {
|
---|
432 | if (!hwndNotify) {
|
---|
433 | if (_beginthread(NoteThread, NULL, 65536, (PVOID) note) == -1)
|
---|
434 | Runtime_Error(pszSrcFile, __LINE__,
|
---|
435 | GetPString(IDS_COULDNTSTARTTHREADTEXT));
|
---|
436 | }
|
---|
437 | }
|
---|
438 |
|
---|
439 | BOOL AddNote(CHAR * note)
|
---|
440 | {
|
---|
441 | CHAR *s, *p;
|
---|
442 | BOOL once = FALSE, ret = FALSE;
|
---|
443 |
|
---|
444 | if ((fThreadNotes || hwndNotify) && note && *note) {
|
---|
445 | p = note;
|
---|
446 | while (*p == ' ')
|
---|
447 | p++;
|
---|
448 | if (*p) {
|
---|
449 | if (!hwndNotify) {
|
---|
450 | fThreadNotes = FALSE;
|
---|
451 | StartNotes(NULL);
|
---|
452 | if (!hwndNotify)
|
---|
453 | DosSleep(33L);
|
---|
454 | if (!hwndNotify)
|
---|
455 | DosSleep(33L);
|
---|
456 | if (!hwndNotify)
|
---|
457 | DosSleep(33L);
|
---|
458 | }
|
---|
459 | if (hwndNotify) {
|
---|
460 | s = xmalloc(strlen(p) + 14, pszSrcFile, __LINE__);
|
---|
461 | if (s) {
|
---|
462 | sprintf(s, "%08lx %s", _threadid, p);
|
---|
463 | while (!once) {
|
---|
464 | if ((SHORT) WinSendDlgItemMsg(hwndNotify,
|
---|
465 | NOTE_LISTBOX,
|
---|
466 | LM_INSERTITEM,
|
---|
467 | MPFROM2SHORT(LIT_END, 0),
|
---|
468 | MPFROMP(s)) >= 0) {
|
---|
469 | ret = TRUE;
|
---|
470 | PostMsg(hwndNotify, UM_NOTIFY, MPVOID, MPVOID);
|
---|
471 | break;
|
---|
472 | }
|
---|
473 | PostMsg(hwndNotify, UM_CONTAINER_FILLED, MPVOID, MPVOID);
|
---|
474 | once = TRUE;
|
---|
475 | }
|
---|
476 | }
|
---|
477 | free(s);
|
---|
478 | }
|
---|
479 | }
|
---|
480 | }
|
---|
481 | return ret;
|
---|
482 | }
|
---|
483 |
|
---|
484 | VOID EndNote(VOID)
|
---|
485 | {
|
---|
486 | if (hwndNotify)
|
---|
487 | if (!PostMsg(hwndNotify, WM_CLOSE, MPVOID, MPVOID))
|
---|
488 | WinSendMsg(hwndNotify, WM_CLOSE, MPVOID, MPVOID);
|
---|
489 | }
|
---|
490 |
|
---|
491 | VOID ShowNote(VOID)
|
---|
492 | {
|
---|
493 | if (!hwndNotify)
|
---|
494 | StartNotes(NULL);
|
---|
495 | if (!hwndNotify)
|
---|
496 | DosSleep(33L);
|
---|
497 | if (!hwndNotify)
|
---|
498 | DosSleep(33L);
|
---|
499 | if (!hwndNotify)
|
---|
500 | DosSleep(33L);
|
---|
501 | if (hwndNotify)
|
---|
502 | PostMsg(hwndNotify, UM_SHOWME, MPVOID, MPVOID);
|
---|
503 | }
|
---|
504 |
|
---|
505 | VOID HideNote(VOID)
|
---|
506 | {
|
---|
507 | if (hwndNotify)
|
---|
508 | WinSetWindowPos(hwndNotify,
|
---|
509 | HWND_BOTTOM,
|
---|
510 | 0,
|
---|
511 | 0, 0, 0, SWP_MINIMIZE | SWP_ZORDER | SWP_FOCUSDEACTIVATE);
|
---|
512 | }
|
---|