home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / windows / mlocal.zip / MLTEST.H < prev    next >
Text File  |  1991-03-16  |  3KB  |  107 lines

  1. /*-----------------------------------------------------------------------------
  2.  MLHTEST.H
  3.  MDI Multiple Local Heap Demo
  4.  11-3-90
  5.  danq
  6. -----------------------------------------------------------------------------*/
  7.  
  8. // Macros
  9. #ifdef RC_INVOKED
  10. #define ID(id) id
  11. #else
  12. #define ID(id) MAKEINTRESOURCE(id)
  13. #endif
  14.  
  15. #define INT                int
  16. #define ActiveHeap         GetWindowWord(hwndActive, WE_HEAP)
  17. #define ActiveArena        GetWindowWord(hwndActive, WE_ARENA)
  18.  
  19. // MDI Window Positions
  20. #define WINDOWMENU         1
  21. #define WINDOWMENUCHILD    2
  22.  
  23. // Style attributes of MDI children
  24. #define CHILDSTYLE         0
  25.  
  26. // Limit of allocations per heap.
  27. // Note: Just necessary for this test app
  28.  
  29. #define ARENALIMIT         25
  30.  
  31. // pseudo arena structure
  32. typedef struct tagLocalArena {
  33.     HANDLE   handle;
  34.     WORD     offset;
  35.     WORD     wFlags;
  36. } LOCALARENA, FAR * LPLOCALARENA;
  37.  
  38. // Strings
  39. #define IDS_APPNAME        1
  40.  
  41. // File Menu Selections
  42. #define IDM_NEW            0x101
  43. #define IDM_ABOUT          0x102
  44. #define IDM_EXIT           0x103
  45. #define IDM_FARLOCAL       0x104
  46. #define IDM_LISTMGR        0x105
  47.  
  48. // Action Menu Selections
  49. #define IDM_ALLOC          0x200
  50. #define IDM_COMPACT        0x201
  51. #define IDM_DISCARD        0x202
  52. #define IDM_FREE           0x204
  53. #define IDM_LOCK           0x206
  54. #define IDM_REALLOC        0x207
  55. #define IDM_SHRINK         0x208
  56. #define IDM_UNLOCK         0x209
  57.  
  58. // Window Menu Selections
  59. #define IDM_WINDOWTILE     0x300
  60. #define IDM_WINDOWCASCADE  0x301
  61. #define IDM_WINDOWICONS    0x302
  62. #define IDM_WINDOWCLOSEALL 0x303
  63. #define IDM_WINDOWCHILD    0x304
  64.  
  65. // menu change message
  66. #define IDM_MENUCHANGE     0x401
  67.  
  68. // heap dialogs
  69. #define ID_BYTES           0x500
  70. #define ID_HANDLE          0x501
  71.  
  72. // Alloc dialog
  73. #define ID_ABYTES          0x600
  74. #define ID_DISC            0x601
  75. #define ID_FIXED           0x602
  76. #define ID_MOVES           0x603
  77. #define ID_NOCOMP          0x604
  78. #define ID_NODISC          0x605
  79. #define ID_ZERO            0x606
  80.  
  81. // Resource ID's
  82. #define IDMLHTest          ID(1)
  83. #define MAINICON           ID(2)
  84. #define CHILDICON          ID(3)
  85. #define AppMenu            ID(4)
  86. #define ChildMenu          ID(5)
  87.  
  88. // Window extra byte definitions
  89. #define WE_EXTRA           4  // Number of Window Extra Bytes
  90. #define WE_ARENA           0  // Local Arena Handle
  91. #define WE_HEAP            2  // Global Memory Handle to Local Heap
  92.  
  93. // Function Prototypes
  94. BOOL InitializeApplication(void);
  95. BOOL InitializeInstance(unsigned int);
  96. BOOL MLHTestCreate(INT);
  97. INT PASCAL WinMain(HANDLE, HANDLE, LPSTR, INT);
  98. LONG FAR PASCAL MDIFrameWndProc(HWND, unsigned, WORD, LONG);
  99. LONG FAR PASCAL MDIChildWndProc(HWND, unsigned, WORD, LONG);
  100. INT FAR PASCAL MainDlgAbout(HWND, unsigned, WORD, LONG);
  101. INT FAR PASCAL NewHeapDlgProc(HWND, unsigned, WORD, LONG);
  102. WORD FAR PASCAL AllocDlgProc(HWND, unsigned, WORD, LONG);
  103. WORD FAR PASCAL ReAllocDlgProc(HWND, unsigned, WORD, LONG);
  104. HANDLE FAR PASCAL HandleDlgProc(HWND, unsigned, WORD, LONG);
  105. BOOL PASCAL QueryCloseAllChildren (VOID);
  106. VOID PASCAL CloseAllChildren (VOID);
  107.