home *** CD-ROM | disk | FTP | other *** search
- /*** info.c ***/
-
- #include <stdio.h>
- #include <string.h>
- #include "windows.h"
- #include "info.h"
-
- extern HWND hInfoWnd;
-
- static char Temp[20];
-
- static char ASstring[19] = " Bytes: ";
- static char XYstring[19] = "Packet: ";
- static struct
- {char FileName[19];
- char FileSize[19];
- char Packet[19];
- char Errors[19];
- char Status[19];
- } InfoData = {"F'Name: ",
- "F'Size: ",
- "Packet: ",
- "Errors: ",
- "Status: "};
-
- void InfoChoose(char Which)
- {if(Which=='A')
- strcpy(&InfoData.Packet[0],ASstring);
- else strcpy(&InfoData.Packet[0],XYstring);
- }
-
- void InfoFileName(char *Ptr)
- {lstrcpy(&InfoData.FileName[8],Ptr);
- }
-
- void InfoFileSize(long Size)
- {sprintf(Temp,"%ld ",Size);
- lstrcpy(&InfoData.FileSize[8],Temp);
- }
-
- void InfoPacket(unsigned int Packet)
- {sprintf(Temp,"%u ",Packet);
- lstrcpy(&InfoData.Packet[8],Temp);
- }
-
- void InfoBytes(unsigned int Bytes)
- {InfoPacket(Bytes);
- }
-
- void InfoErrors(int Errors)
- {sprintf(Temp,"%d ",Errors);
- lstrcpy(&InfoData.Errors[8],Temp);
- }
-
- void InfoStatus(char *Ptr)
- {lstrcpy(&InfoData.Status[8],Ptr);
- }
-
- long FAR PASCAL InfoWndProc(HWND hWnd,UINT iMessage, UINT wParam, LONG lParam)
- {HDC hDC;
- hInfoWnd = hWnd;
- switch(iMessage)
- {case WM_USER:
- hDC = GetDC(hInfoWnd);
- SetMapMode(hDC,MM_ANISOTROPIC);
- SelectObject(hDC, GetStockObject(OEM_FIXED_FONT) );
- TextOut(hDC, 0, 0, InfoData.FileName, strlen(InfoData.FileName) );
- TextOut(hDC, 0, 15, InfoData.FileSize, strlen(InfoData.FileSize) );
- TextOut(hDC, 0, 30, InfoData.Packet, strlen(InfoData.Packet) );
- TextOut(hDC, 0, 45, InfoData.Errors, strlen(InfoData.Errors) );
- TextOut(hDC, 0, 60, InfoData.Status, strlen(InfoData.Status) );
- ReleaseDC(hInfoWnd,hDC);
- break;
- case WM_DESTROY:
- PostQuitMessage(0);
- break;
- default:
- return DefWindowProc(hInfoWnd,iMessage,wParam,lParam);
- } /* end switch */
- return 0L;
- } /* end InfoWndProc */