Changeset 356 for trunk/dll/notify.c
- Timestamp:
- Jul 26, 2006, 9:58:37 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/dll/notify.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/notify.c
r2 r356 1 2 /*********************************************************************** 3 4 $Id$ 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 14 ***********************************************************************/ 15 1 16 #define INCL_DOS 2 17 #define INCL_WIN 3 18 #define INCL_GPI 4 5 19 #include <os2.h> 20 6 21 #include <stdarg.h> 7 22 #include <stdio.h> … … 11 26 #include <time.h> 12 27 #include <stddef.h> 28 13 29 #include "fm3dll.h" 14 30 #include "fm3dlg.h" … … 16 32 17 33 #pragma data_seg(DATA1) 34 35 static PSZ pszSrcFile = __FILE__; 36 18 37 #pragma alloc_text(NOTIFY,Notify,NotifyWndProc,StartNotify) 19 38 #pragma alloc_text(NOTIFY,NotifyThread,NotifyError) … … 23 42 static HWND hwndNotify; 24 43 25 26 MRESULT EXPENTRY NotifyWndProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) { 27 44 MRESULT EXPENTRY NotifyWndProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) 45 { 28 46 static ULONG showing = 0; 29 47 … … 39 57 ID_TIMER2, 40 58 5000)) { 41 DosBeep(50,100);59 Win_Error(hwnd,hwnd,pszSrcFile,__LINE__,"WinStartTimer"); 42 60 WinDestroyWindow(hwnd); 43 61 } … … 125 143 126 144 127 HWND DoNotify (char *str) {128 145 HWND DoNotify (char *str) 146 { 129 147 char *p; 130 148 HWND hwnd = (HWND)0,hwndP; … … 157 175 /* pretty-up the note by putting on a leading space */ 158 176 if(*str != ' ') { 159 p = malloc(strlen(str) + 2);177 p = xmalloc(strlen(str) + 2,pszSrcFile,__LINE__); 160 178 if(!p) 161 179 p = str; … … 193 211 194 212 195 HWND Notify (char *str) {196 213 HWND Notify (char *str) 214 { 197 215 return (HWND)WinSendMsg(MainObjectHwnd,UM_NOTIFY,MPFROMP(str),MPVOID); 198 216 } 199 217 200 218 201 VOID NotifyError (CHAR *filename,APIRET status) {202 219 VOID NotifyError (CHAR *filename,APIRET status) 220 { 203 221 CHAR errortext[512]; 204 222 … … 241 259 242 260 243 MRESULT EXPENTRY NoteWndProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) {244 261 MRESULT EXPENTRY NoteWndProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) 262 { 245 263 static HPOINTER hptrIcon = (HPOINTER)0; 246 264 … … 459 477 460 478 461 VOID NoteThread (VOID *args) {462 479 VOID NoteThread (VOID *args) 480 { 463 481 HAB hab2; 464 482 HMQ hmq2; … … 482 500 483 501 484 BOOL StartNotes (CHAR *note) { 485 486 if(!hwndNotify) { 487 if(_beginthread(NoteThread, 488 NULL, 489 65536, 490 (PVOID)note) != -1) 491 return TRUE; 492 } 493 else 494 return TRUE; 495 return FALSE; 496 } 497 498 499 BOOL AddNote (CHAR *note) { 500 502 VOID StartNotes (CHAR *note) 503 { 504 if (!hwndNotify) { 505 if (_beginthread(NoteThread,NULL,65536,(PVOID)note) == -1) 506 Runtime_Error(pszSrcFile, __LINE__, GetPString(IDS_COULDNTSTARTTHREADTEXT)); 507 } 508 } 509 510 511 BOOL AddNote (CHAR *note) 512 { 501 513 CHAR *s,*p; 502 514 BOOL once = FALSE,ret = FALSE; … … 549 561 550 562 551 VOID EndNote (VOID) {552 563 VOID EndNote (VOID) 564 { 553 565 if(hwndNotify) 554 566 if(!PostMsg(hwndNotify, … … 563 575 564 576 565 VOID ShowNote (VOID) {566 577 VOID ShowNote (VOID) 578 { 567 579 if(!hwndNotify) 568 580 StartNotes(NULL); … … 581 593 582 594 583 VOID HideNote (VOID) {584 595 VOID HideNote (VOID) 596 { 585 597 if(hwndNotify) 586 598 WinSetWindowPos(hwndNotify,
Note:
See TracChangeset
for help on using the changeset viewer.
