home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 19.ddi / SAMPLES / DDEML / CLOCK / DDEMLCLK.H_ / DDEMLCLK.H
Encoding:
C/C++ Source or Header  |  1993-02-08  |  2.9 KB  |  69 lines

  1. /****************************************************************************
  2.  *                                        *
  3.  *  FILE    : DDEMLCLK.h                               *
  4.  *                                        *
  5.  *  DESCRIPTION : Header file for the Clock sample application.             *
  6.  *                                        *
  7.  ****************************************************************************/
  8. #include "resource.h"
  9.  
  10. #define BUFLEN        30 /* name buffer length */
  11.  
  12. #define MAXDOTWIDTH   25 /* maximum hour-marking dot width  */
  13. #define MINDOTWIDTH   2  /* minimum hour-marking dot width  */
  14. #define MINDOTHEIGHT  1  /* minimum hour-marking dot height */
  15.  
  16. /* hand and paint flags */
  17. #define HHAND         TRUE
  18. #define MHAND         FALSE
  19. #define PAINTALL      0
  20. #define HANDPAINT     1
  21.  
  22. /* timer interval when the clock window is ...            */
  23. #define OPEN_TLEN     450    /* ... open   (every second) */
  24. #define ICON_TLEN     59000  /* ... iconic (every minute) */
  25.  
  26. /* distance from the center of the clock to ...                 */
  27. #define HOURSIDE      7   /* ... either side of the hour hand   */
  28. #define MINUTESIDE    5   /* ... either side of the minute hand */
  29. #define HOURTIP       65  /* ... the tip of the hour hand       */
  30. #define MINUTETIP     80  /* ... the tip of the minute hand     */
  31. #define SECONDTIP     80  /* ... the tip of the second hand     */
  32. #define HOURTAIL      15  /* ... the tail of the hour hand      */
  33. #define MINUTETAIL    20  /* ... the tail of the minute hand    */
  34.  
  35. /* conversion factors */
  36. #define CIRTABSCALE   8000 /* circle table values scale down value  */
  37. #define MMPERDM       100  /* millimeters per decimeter             */
  38.  
  39. /* number of hand positions on ...                                     */
  40. #define HANDPOSITIONS 60                   /* ... entire clock         */
  41. #define SIDESHIFT     (HANDPOSITIONS >> 2) /* ...  90 degrees of clock */
  42. #define TAILSHIFT     (HANDPOSITIONS >> 1) /* ... 180 degrees of clock */
  43.  
  44. /* declarations for exported functions */
  45. long FAR PASCAL __export ClockWndProc(HWND, UINT, WPARAM, LPARAM);
  46. BOOL FAR PASCAL __export About(HWND, unsigned, WORD, LONG);
  47. VOID CreateTools(VOID);
  48. VOID DeleteTools(VOID);
  49. VOID ClockCreate(VOID);
  50. VOID ClockSize(HWND hWnd, int  newWidth, int  newHeight, WORD sizeType);
  51. VOID ClockTimer(HWND hWnd);
  52. VOID ClockPaint(HWND hWnd, HDC  hDC, int  paintType);
  53. VOID DrawFace(HDC hDC);
  54. VOID DrawHand(HDC  hDC, int  pos, HPEN hPen, int  scale, int  patMode);
  55. VOID DrawFatHand(HDC  hDC, int  pos, HPEN hPen, BOOL hHand);
  56. VOID CircleClock(int maxWidth, int maxHeight);
  57. BOOL ClockInit(VOID);
  58. HDDEDATA EXPENTRY DdeCallback(WORD usType, WORD usFmt, HCONV hConv,
  59.     HSZ hsz1, HSZ hsz2, HDDEDATA hData, DWORD lData1, DWORD lData2); 
  60.     
  61. typedef struct
  62. {
  63.     int hour;
  64.     int minute;
  65.     int second;
  66. } TIME;
  67.  
  68. extern void GetTime(TIME *); /* function to get current time */
  69. extern void SetTime(TIME *); /* function to set current time */