|
|
1.1 root 1: /*--------------------- file identification ------------------------*/
2:
3: /*
4: * within.h
5: *
6: * include file for within.c
7: *
8: * Created by Microsoft Corp., 1988
9: */
10:
11:
12: /*------------------------- functional macros ----------------------*/
13:
14: #define ElementsIn(someArray) (sizeof someArray / sizeof someArray[0])
15:
16:
17: /*---------------------- function prototypes -----------------------*/
18:
19: SHORT cdecl main (VOID) ;
20: BOOL initialize (ULONG * pafInitFlags) ;
21: VOID messageLoop (VOID) ;
22: VOID cleanUp (ULONG afInitFlags) ;
23: VOID fillWindowWithMessage (HPS hpsPS, HWND hwnd,
24: PRECTL prclInvalidRect,
25: CHAR szSomeMessage [],
26: ULONG aclrColors [],
27: SHORT sNumColors );
28: MRESULT EXPENTRY ChildClientWndProc (HWND hwnd, USHORT usMessage,
29: MPARAM mp1, MPARAM mp2) ;
30: BOOL dealWindowQuit (HWND hwnd) ;
31: MRESULT APIENTRY ChildFrameWndProc(HWND hwnd, USHORT msg,
32: MPARAM mp1, MPARAM mp2) ;
33: BOOL DoNew (ULONG * pafInitFlags) ;
34: BOOL createNewChildStdFrame (PHWND phwndFrame, PHWND phwndClient,
35: HWND hwndParent) ;
36:
37: VOID getPathString (HWND hwndParent, CHAR * szPathString) ;
38:
39: VOID reverseString (CHAR szSomeString[]) ;
40:
41:
42: /*----------------------- global constants -------------------------*/
43:
44: /* initialization flags */
45: #define MESSAGE_HANDLED 0x00000000UL
46: #define GOT_ANCHOR_BLOCK 0x00000001UL
47: #define GOT_MESSAGE_QUEUE 0X00000002UL
48: #define GOT_TOP_CLIENT_CLASS 0x00000004UL
49: #define GOT_CHILD_CLIENT_CLASS 0x00000008UL
50: #define GOT_CLIENT_CLASS 0x00000004UL
51: #define GOT_CHILD_CLASS 0x00000008UL
52: #define GOT_TOP_FRAME_WINDOW 0x00000010UL
53: #define GOT_CHILD_FRAME_WINDOW 0x00000020UL
54:
55: /* number of child windows */
56: #define NUM_CHILDREN 3
57:
58: /* number of grandchild windows */
59: #define NUM_GRAND_CHILDREN 4
60:
61: /* a resource ID for menus, dialogs, icons */
62: #define RSRC_ID_within 1
63:
64: /* ids for the submenus */
65: #define MENU_ID_WINDOW 1000
66:
67: /* ids for submenu items */
68: #define WINDOW_NEW 1001
69: #define WINDOW_AUTOTILE 1002
70:
71:
72: /*--------------------- global types -------------------------------*/
73:
74: typedef struct { /* wnbtz */
75: USHORT usChildID ;
76: USHORT usGeneration ;
77: USHORT usNumChildren ;
78: USHORT usAbsoluteID ;
79: } winbytz;
80:
81: #define US_CHILD_ID 0
82: #define US_GENERATION 2
83: #define US_NUM_CHILDREN 4
84: #define US_ABSOLUTE_ID 6
85:
86: #define TOP_LEVEL 0
87:
88: /*--------------------- global variables ---------------------------*/
89:
90: /* state flags */
91: BOOL fAutotile ; /* autotiling enabled/disabled */
92:
93:
94:
95: HAB habAnchorBlock ; /* our anchor block */
96: HMQ hmqMessageQueue ; /* our message queue */
97: HWND hwndTopFrame ; /* handle to top-level frame window */
98: HWND hwndTopClient ; /* handle to top-level client window */
99: HWND hwndChildFrame[NUM_CHILDREN] ; /* array of handles to
100: the frame windows */
101: HWND hwndChildClient[NUM_CHILDREN] ; /* array of handles to
102: the client windows */
103: PFNWP pfnwpRegFrameWndProc ;
104: HWND hwndDeskTop ;
105:
106: CHAR szOurNameTitle[] = "within" ;
107: CHAR szOurNameClient[] = "within client" ;
108: CHAR szOurNameChildClient [] = "within child client" ;
109: CHAR szOurNameChild[] = "within child" ;
110: CHAR szOurNameGrandChild[] = "within child child" ;
111: CHAR szTopClientMessage[] = "heheheheheheh" ;
112:
113: LONG aclrColors [] = {
114: CLR_WHITE,
115: CLR_BLACK,
116: CLR_BLUE,
117: CLR_RED,
118: CLR_PINK,
119: CLR_GREEN,
120: CLR_CYAN,
121: CLR_YELLOW,
122: CLR_DARKGRAY,
123: CLR_PALEBLUE,
124: CLR_PALERED,
125: CLR_PALEPINK,
126: CLR_DARKGREEN,
127: CLR_DARKCYAN,
128: CLR_BROWN,
129: CLR_PALEGRAY } ;
130:
131: LONG aclrChildColorArray00 [] = {CLR_BLUE, CLR_PALEBLUE, CLR_CYAN} ;
132: LONG aclrChildColorArray01 [] = {CLR_RED, CLR_BROWN} ;
133: LONG aclrChildColorArray02 [] = {CLR_BROWN, CLR_YELLOW, CLR_PINK} ;
134: LONG aclrChildColorArray03 [] = {CLR_GREEN, CLR_CYAN, CLR_DARKGREEN} ;
135: LONG aclrChildColorArray04 [] = {CLR_PALEGRAY, CLR_PALEBLUE} ;
136: LONG aclrChildColorArray05 [] = {CLR_GREEN, CLR_DARKGREEN} ;
137: LONG aclrChildColorArray06 [] = {CLR_PINK, CLR_RED} ;
138: LONG aclrChildColorArray07 [] = {CLR_DARKCYAN, CLR_BLUE} ;
139: LONG aclrChildColorArray08 [] = {CLR_PALEBLUE, CLR_PALEGRAY} ;
140: LONG aclrChildColorArray09 [] = {CLR_PALERED} ;
141: LONG aclrChildColorArray10 [] = {CLR_YELLOW, CLR_GREEN} ;
142: LONG aclrChildColorArray11 [] = {CLR_DARKCYAN, CLR_CYAN} ;
143: LONG aclrChildColorArray12 [] = {CLR_BLUE} ;
144: LONG aclrChildColorArray13 [] = {CLR_BLUE} ;
145: LONG aclrChildColorArray14 [] = {CLR_PALEPINK, CLR_PALEGRAY} ;
146: LONG aclrChildColorArray15 [] = {CLR_DARKGREEN} ;
147:
148:
149: SHORT asChildColorArraySizes[] = { ElementsIn(aclrChildColorArray00),
150: ElementsIn(aclrChildColorArray01),
151: ElementsIn(aclrChildColorArray02),
152: ElementsIn(aclrChildColorArray03),
153: ElementsIn(aclrChildColorArray04),
154: ElementsIn(aclrChildColorArray05),
155: ElementsIn(aclrChildColorArray06),
156: ElementsIn(aclrChildColorArray07),
157: ElementsIn(aclrChildColorArray08),
158: ElementsIn(aclrChildColorArray09),
159: ElementsIn(aclrChildColorArray10),
160: ElementsIn(aclrChildColorArray11),
161: ElementsIn(aclrChildColorArray12),
162: ElementsIn(aclrChildColorArray13),
163: ElementsIn(aclrChildColorArray14),
164: ElementsIn(aclrChildColorArray15) } ;
165:
166:
167:
168:
169:
170:
171:
172: LONG * apaclrChildColorArrays [] = { aclrChildColorArray00,
173: aclrChildColorArray01,
174: aclrChildColorArray02,
175: aclrChildColorArray03,
176: aclrChildColorArray04,
177: aclrChildColorArray05,
178: aclrChildColorArray06,
179: aclrChildColorArray07,
180: aclrChildColorArray08,
181: aclrChildColorArray09,
182: aclrChildColorArray10,
183: aclrChildColorArray11,
184: aclrChildColorArray12,
185: aclrChildColorArray13,
186: aclrChildColorArray14,
187: aclrChildColorArray15 } ;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.