|
|
Microsoft OS/2 SDK PM 08-08-1988
/*--------------------- file identification ------------------------*/
/*
* within.h
*
* include file for within.c
*
* Created by Microsoft Corp., 1988
*/
/*------------------------- functional macros ----------------------*/
#define ElementsIn(someArray) (sizeof someArray / sizeof someArray[0])
/*---------------------- function prototypes -----------------------*/
SHORT cdecl main (VOID) ;
BOOL initialize (ULONG * pafInitFlags) ;
VOID messageLoop (VOID) ;
VOID cleanUp (ULONG afInitFlags) ;
VOID fillWindowWithMessage (HPS hpsPS, HWND hwnd,
PRECTL prclInvalidRect,
CHAR szSomeMessage [],
ULONG aclrColors [],
SHORT sNumColors );
MRESULT EXPENTRY ChildClientWndProc (HWND hwnd, USHORT usMessage,
MPARAM mp1, MPARAM mp2) ;
BOOL dealWindowQuit (HWND hwnd) ;
MRESULT APIENTRY ChildFrameWndProc(HWND hwnd, USHORT msg,
MPARAM mp1, MPARAM mp2) ;
BOOL DoNew (ULONG * pafInitFlags) ;
BOOL createNewChildStdFrame (PHWND phwndFrame, PHWND phwndClient,
HWND hwndParent) ;
VOID getPathString (HWND hwndParent, CHAR * szPathString) ;
VOID reverseString (CHAR szSomeString[]) ;
/*----------------------- global constants -------------------------*/
/* initialization flags */
#define MESSAGE_HANDLED 0x00000000UL
#define GOT_ANCHOR_BLOCK 0x00000001UL
#define GOT_MESSAGE_QUEUE 0X00000002UL
#define GOT_TOP_CLIENT_CLASS 0x00000004UL
#define GOT_CHILD_CLIENT_CLASS 0x00000008UL
#define GOT_CLIENT_CLASS 0x00000004UL
#define GOT_CHILD_CLASS 0x00000008UL
#define GOT_TOP_FRAME_WINDOW 0x00000010UL
#define GOT_CHILD_FRAME_WINDOW 0x00000020UL
/* number of child windows */
#define NUM_CHILDREN 3
/* number of grandchild windows */
#define NUM_GRAND_CHILDREN 4
/* a resource ID for menus, dialogs, icons */
#define RSRC_ID_within 1
/* ids for the submenus */
#define MENU_ID_WINDOW 1000
/* ids for submenu items */
#define WINDOW_NEW 1001
#define WINDOW_AUTOTILE 1002
/*--------------------- global types -------------------------------*/
typedef struct { /* wnbtz */
USHORT usChildID ;
USHORT usGeneration ;
USHORT usNumChildren ;
USHORT usAbsoluteID ;
} winbytz;
#define US_CHILD_ID 0
#define US_GENERATION 2
#define US_NUM_CHILDREN 4
#define US_ABSOLUTE_ID 6
#define TOP_LEVEL 0
/*--------------------- global variables ---------------------------*/
/* state flags */
BOOL fAutotile ; /* autotiling enabled/disabled */
HAB habAnchorBlock ; /* our anchor block */
HMQ hmqMessageQueue ; /* our message queue */
HWND hwndTopFrame ; /* handle to top-level frame window */
HWND hwndTopClient ; /* handle to top-level client window */
HWND hwndChildFrame[NUM_CHILDREN] ; /* array of handles to
the frame windows */
HWND hwndChildClient[NUM_CHILDREN] ; /* array of handles to
the client windows */
PFNWP pfnwpRegFrameWndProc ;
HWND hwndDeskTop ;
CHAR szOurNameTitle[] = "within" ;
CHAR szOurNameClient[] = "within client" ;
CHAR szOurNameChildClient [] = "within child client" ;
CHAR szOurNameChild[] = "within child" ;
CHAR szOurNameGrandChild[] = "within child child" ;
CHAR szTopClientMessage[] = "heheheheheheh" ;
LONG aclrColors [] = {
CLR_WHITE,
CLR_BLACK,
CLR_BLUE,
CLR_RED,
CLR_PINK,
CLR_GREEN,
CLR_CYAN,
CLR_YELLOW,
CLR_DARKGRAY,
CLR_PALEBLUE,
CLR_PALERED,
CLR_PALEPINK,
CLR_DARKGREEN,
CLR_DARKCYAN,
CLR_BROWN,
CLR_PALEGRAY } ;
LONG aclrChildColorArray00 [] = {CLR_BLUE, CLR_PALEBLUE, CLR_CYAN} ;
LONG aclrChildColorArray01 [] = {CLR_RED, CLR_BROWN} ;
LONG aclrChildColorArray02 [] = {CLR_BROWN, CLR_YELLOW, CLR_PINK} ;
LONG aclrChildColorArray03 [] = {CLR_GREEN, CLR_CYAN, CLR_DARKGREEN} ;
LONG aclrChildColorArray04 [] = {CLR_PALEGRAY, CLR_PALEBLUE} ;
LONG aclrChildColorArray05 [] = {CLR_GREEN, CLR_DARKGREEN} ;
LONG aclrChildColorArray06 [] = {CLR_PINK, CLR_RED} ;
LONG aclrChildColorArray07 [] = {CLR_DARKCYAN, CLR_BLUE} ;
LONG aclrChildColorArray08 [] = {CLR_PALEBLUE, CLR_PALEGRAY} ;
LONG aclrChildColorArray09 [] = {CLR_PALERED} ;
LONG aclrChildColorArray10 [] = {CLR_YELLOW, CLR_GREEN} ;
LONG aclrChildColorArray11 [] = {CLR_DARKCYAN, CLR_CYAN} ;
LONG aclrChildColorArray12 [] = {CLR_BLUE} ;
LONG aclrChildColorArray13 [] = {CLR_BLUE} ;
LONG aclrChildColorArray14 [] = {CLR_PALEPINK, CLR_PALEGRAY} ;
LONG aclrChildColorArray15 [] = {CLR_DARKGREEN} ;
SHORT asChildColorArraySizes[] = { ElementsIn(aclrChildColorArray00),
ElementsIn(aclrChildColorArray01),
ElementsIn(aclrChildColorArray02),
ElementsIn(aclrChildColorArray03),
ElementsIn(aclrChildColorArray04),
ElementsIn(aclrChildColorArray05),
ElementsIn(aclrChildColorArray06),
ElementsIn(aclrChildColorArray07),
ElementsIn(aclrChildColorArray08),
ElementsIn(aclrChildColorArray09),
ElementsIn(aclrChildColorArray10),
ElementsIn(aclrChildColorArray11),
ElementsIn(aclrChildColorArray12),
ElementsIn(aclrChildColorArray13),
ElementsIn(aclrChildColorArray14),
ElementsIn(aclrChildColorArray15) } ;
LONG * apaclrChildColorArrays [] = { aclrChildColorArray00,
aclrChildColorArray01,
aclrChildColorArray02,
aclrChildColorArray03,
aclrChildColorArray04,
aclrChildColorArray05,
aclrChildColorArray06,
aclrChildColorArray07,
aclrChildColorArray08,
aclrChildColorArray09,
aclrChildColorArray10,
aclrChildColorArray11,
aclrChildColorArray12,
aclrChildColorArray13,
aclrChildColorArray14,
aclrChildColorArray15 } ;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.