Changeset 335 for trunk/dll/seticon.c
- Timestamp:
- Jul 25, 2006, 9:03:44 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/dll/seticon.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/seticon.c
r2 r335 1 2 /*********************************************************************** 3 4 $Id$ 5 6 Edit ICON EA 7 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2006 Steven H.Levine 10 11 17 Jul 06 SHL Use Runtime_Error 12 13 ***********************************************************************/ 14 1 15 #define INCL_DOS 2 16 #define INCL_WIN 17 #include <os2.h> 3 18 4 #include <os2.h>5 19 #include <stdio.h> 6 20 #include <stdlib.h> … … 8 22 #include <ctype.h> 9 23 #include <share.h> 24 10 25 #include "fm3dll.h" 11 26 #include "fm3dlg.h" 12 27 13 28 #pragma data_seg(DATA2) 29 30 static PSZ pszSrcFile = __FILE__; 31 14 32 #pragma alloc_text(MENU,SetIconDlgProc) 15 33 16 34 17 18 MRESULT EXPENTRY SetIconDlgProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) { 19 35 MRESULT EXPENTRY SetIconDlgProc (HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2) 36 { 20 37 switch(msg) { 21 38 case WM_INITDLG: … … 43 60 icf.cb = sizeof(ICONINFO); 44 61 icf.fFormat = ICON_DATA; 45 if(filename && *filename) { 46 fp = _fsopen(filename,"rb",SH_DENYNO); 47 if(fp) { 62 if (filename && *filename) { 63 fp = xfsopen(filename,"rb",SH_DENYNO,pszSrcFile,__LINE__); 64 if(!fp) 65 break; 66 else { 48 67 fseek(fp,0L,SEEK_END); 49 68 icf.cbIconData = ftell(fp); 50 69 fseek(fp,0L,SEEK_SET); 51 buff = malloc(icf.cbIconData);52 if (!buff) {70 buff = xmalloc(icf.cbIconData,pszSrcFile,__LINE__); 71 if (!buff) { 53 72 fclose(fp); 54 DosBeep(50,100);55 73 break; 56 74 } … … 58 76 icf.pIconData = (PVOID)buff; 59 77 fclose(fp); 60 }61 else {62 DosBeep(50,100);63 break;64 78 } 65 79 } … … 79 93 (PICONINFO)((filename && *filename) ? 80 94 &icf : NULL))) 81 DosBeep(250,100); 95 { 96 Win_Error(hwnd,hwnd,pszSrcFile,__LINE__,"WinSetSysPointerData"); 97 } 82 98 if(buff) 83 99 free(buff);
Note:
See TracChangeset
for help on using the changeset viewer.
