winnt-port-cleanup-20010111
[openafs.git] / src / WINNT / afsapplib / ctl_time.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #ifndef CTL_TIME_H
11 #define CTL_TIME_H
12
13 /*
14  * DEFINITIONS ________________________________________________________________
15  *
16  */
17
18 #ifndef THIS_HINST
19 #define THIS_HINST  (HINSTANCE)GetModuleHandle(NULL)
20 #endif
21
22 #ifndef EXPORTED
23 #define EXPORTED
24 #endif
25
26 #ifndef limit
27 #define limit(_a,_x,_b)  min( max( (_x), (_a) ), (_b) )
28 #endif
29
30 #ifndef inlimit
31 #define inlimit(_a,_x,_b)  ( (((_x)>=(_a)) && ((_x)<=(_b))) ? TRUE : FALSE )
32 #endif
33
34 #ifndef cxRECT
35 #define cxRECT(_r)  ((_r).right - (_r).left)
36 #endif
37
38 #ifndef cyRECT
39 #define cyRECT(_r)  ((_r).bottom - (_r).top)
40 #endif
41
42
43 /*
44  * PROTOTYPES _________________________________________________________________
45  *
46  */
47
48
49 EXPORTED BOOL RegisterTimeClass (void);
50
51 #define TM_GETTIME    (WM_USER+311) // SYSTEMTIME *pTime = lp;
52 #define TM_SETTIME    (WM_USER+312) // SYSTEMTIME *pTime = lp;
53
54 #define TN_CHANGE     0x1005  // SYSTEMTIME *pTime = lp;
55 #define TN_UPDATE     0x1006  // SYSTEMTIME *pTime = lp;
56
57 /*
58  * void TI_GetTime (HWND hTime, SYSTEMTIME *pTime)
59  * void TI_SetTime (HWND hTime, SYSTEMTIME *pTime)
60  *
61  */
62 #define TI_GetTime(_htime,_pTime) \
63         SendMessage(_htime,TM_GETTIME,(WPARAM)0,(LPARAM)_pTime)
64 #define TI_SetTime(_htime,_pTime) \
65         SendMessage(_htime,TM_SETTIME,(WPARAM)0,(LPARAM)_pTime)
66
67
68 #endif
69