home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / MDI-15.ZIP / MDI.H < prev    next >
Text File  |  1990-08-29  |  11KB  |  182 lines

  1. // Guard Against Multiple Inclusion
  2. // --------------------------------
  3.    #if !defined(MDI_H)
  4.       #define MDI_H
  5.  
  6. // Constants
  7. // ---------
  8.    #define MDI_DESKTOPCLASS             "MDIDesktop"
  9.    #define MDI_DOCUMENTCLASS            "MDIDocument"
  10.    #define MDI_MODNAME                  "MDI.DLL"
  11.  
  12.  
  13. // Messages (can be sent to both the desktop and document windows)
  14. // ---------------------------------------------------------------
  15.    #define MDI_MSG_LOCATE_DESKTOP_DATA    WM_USER+1
  16.                                         // mp1 : NULL
  17.                                         // mp2 : NULL
  18.                                         // Returns PVOID to desktop data
  19.  
  20.    #define MDI_MSG_LOCATE_DOCUMENT_DATA   WM_USER+2
  21.                                         // mp1 : NULL
  22.                                         // mp2 : NULL
  23.                                         // Returns PVOID to document data
  24.                                         //  (currently active document if sent to desktop window)
  25.  
  26.    #define MDI_MSG_LOCATE_INSTANCE_DATA   WM_USER+3
  27.                                         // mp1 : NULL
  28.                                         // mp2 : NULL
  29.                                         // Returns PVOID to document instance data
  30.                                         //  (currently active document if sent to desktop window)
  31.  
  32.    #define MDI_MSG_LOCATE_ACTIVE_DOCUMENT WM_USER+4
  33.                                         // mp1 : NULL
  34.                                         // mp2 : NULL
  35.                                         // Returns HWND of active document
  36.                                         //  (current document if sent to document window)
  37.  
  38.    #define MDI_MSG_LOCATE_DESKTOP_MENU    WM_USER+5
  39.                                         // mp1 : NULL
  40.                                         // mp2 : NULL
  41.                                         // Returns HWND of desktop menu
  42.  
  43.    #define MDI_MSG_LOCATE_DOCUMENT_MENU   WM_USER+6
  44.                                         // mp1 : NULL
  45.                                         // mp2 : NULL
  46.                                         // Returns HWND of document menu
  47.                                         //  (currently active document if sent to desktop window)
  48.  
  49.    #define MDI_MSG_SET_DESKTOP_TITLE      WM_USER+7
  50.                                         // mp1 : PCHAR szTitleText
  51.                                         // mp2 : NULL
  52.                                         // Sets the title text for the desktop. If this message is
  53.                                         //  never sent, the title of the desktop as supplied in the
  54.                                         //  MDICreateDesktop call is used.
  55.  
  56.    #define MDI_MSG_SET_INSTANCE_TITLE     WM_USER+8
  57.                                         // mp1 : PCHAR szTitleText
  58.                                         // mp2 : NULL
  59.                                         // Sets the title text for the document instance. If this message is
  60.                                         //  never sent, the title of the document as supplied in the
  61.                                         //  MDICreateDocument call, suffixed if necessary with the instance index, is used.
  62.  
  63.  
  64. // WM_CONTROL Notification codes
  65. // -----------------------------
  66.    #define MDI_NOTIFY_CREATE_DESKTOP    1
  67.                                         // mp1 : MPFROM2SHORT (idDesktop, MDI_NOTIFY_CREATE_DESKTOP)
  68.                                         // mp2 : PVOID pvDeskData
  69.  
  70.    #define MDI_NOTIFY_DESTROY_DESKTOP   2
  71.                                         // mp1 : MPFROM2SHORT (idDesktop, MDI_NOTIFY_DESTROY_DESKTOP)
  72.                                         // mp2 : PVOID pvDeskData
  73.  
  74.    #define MDI_NOTIFY_CREATE_DOCUMENT   3
  75.                                         // mp1 : MPFROM2SHORT (idDesktop, MDI_NOTIFY_CREATE_DOCUMENT)
  76.                                         // mp2 : PVOID pvDocData
  77.  
  78.    #define MDI_NOTIFY_CREATE_INSTANCE   4
  79.                                         // mp1 : MPFROM2SHORT (idDesktop, MDI_NOTIFY_CREATE_INSTANCE)
  80.                                         // mp2 : PVOID pvInstData
  81.  
  82.    #define MDI_NOTIFY_DESTROY_DOCUMENT  5
  83.                                         // mp1 : MPFROM2SHORT (idDesktop, MDI_NOTIFY_DESTROY_DOCUMENT)
  84.                                         // mp2 : PVOID pvDocData
  85.  
  86.    #define MDI_NOTIFY_DESTROY_INSTANCE  6
  87.                                         // mp1 : MPFROM2SHORT (idDesktop, MDI_NOTIFY_DESTROY_INSTANCE)
  88.                                         // mp2 : PVOID pvInstData
  89.  
  90.    #define MDI_INHIBIT_CLOSE_DESKTOP    7
  91.                                         // mp1 : MPFROM2SHORT (idDesktop, MDI_INHIBIT_CLOSE_DESKTOP)
  92.                                         // mp2 : PVOID pvDeskData
  93.                                         // Return TRUE if the desktop close is to be inhibited;
  94.                                         //  otherwise return NULL. A "request save" message may be issued
  95.                                         //  to the user in response to this message.
  96.  
  97.    #define MDI_INHIBIT_CLOSE_INSTANCE   8
  98.                                         // mp1 : MPFROM2SHORT (idDesktop, MDI_INHIBIT_CLOSE_INSTANCE)
  99.                                         // mp2 : PVOID pvInstData
  100.                                         // Return TRUE if the document instance close is to be inhibited;
  101.                                         //  otherwise return NULL. A "request save" message may be issued
  102.                                         //  to the user in response to this message.
  103.  
  104.    #define MDI_NOTIFY_CASCADE_INSTANCE  9
  105.                                         // mp1 : MPFROM2SHORT (idDesktop, MDI_NOTIFY_CASCADE_INSTANCE)
  106.                                         // mp2 : PVOID pvInstData
  107.                                         // Sent to each document instance that is NOT an icon
  108.                                         // when a cascade operation is performed
  109.  
  110.    #define MDI_NOTIFY_TILE_INSTANCE     10
  111.                                         // mp1 : MPFROM2SHORT (idDesktop, MDI_NOTIFY_TILE_INSTANCE)
  112.                                         // mp2 : PVOID pvInstData
  113.                                         // Sent to each document instance that is NOT an icon
  114.                                         // when a tile operation is performed
  115.  
  116.    #define MDI_NOTIFY_ACTIVATE_INSTANCE 11
  117.                                         // mp1 : MPFROM2SHORT (idDesktop, MDI_NOTIFY_ACTIVATE_INSTANCE)
  118.                                         // mp2 : PVOID pvInstData
  119.  
  120.    #define MDI_NOTIFY_DEACTIVATE_INSTANCE 12
  121.                                         // mp1 : MPFROM2SHORT (idDesktop, MDI_NOTIFY_DEACTIVATE_INSTANCE)
  122.                                         // mp2 : PVOID pvInstData
  123.  
  124.  
  125. // Function Declarations
  126. // ---------------------
  127.    HWND    EXPENTRY MDICreateDesktop    (PFNWP, ULONG, PCHAR, HMODULE, USHORT, PHWND, USHORT, USHORT, PCHAR, PCHAR, PCHAR, ULONG);
  128.                                         // PFNWP   : your desktop window procedure
  129.                                         // ULONG   : FCF_* flags for the desktop frame
  130.                                         // PCHAR   : initial desktop title text
  131.                                         // HMODULE : module handle for resources (or NULL if in .EXE)
  132.                                         // USHORT  : id of resources
  133.                                         // PHWND   : pointer to area in which handle to desktop client is returned
  134.                                         // USHORT  : size of re-entrant desktop data
  135.                                         // USHORT  : id of desktop frame
  136.                                         // PCHAR   : text of menu entry before which document menu deltas are inserted
  137.                                         // PCHAR   : text of menu entry before which the "window" menu entry is inserted
  138.                                         // PCHAR   : desired text of "window" menu entry
  139.                                         // ULONG   : mask of options (see below)
  140.  
  141.    #define MDI_KEEP_WINDOWS_MENU        0x00000001L // --don't remove the windows menu
  142.    #define MDI_INITIAL_TILE_ALWAYS      0x00000002L // --set tile always as the initial state
  143.    #define MDI_INITIAL_CASCADE_ALWAYS   0x00000004L // --set cascade always as the initial state
  144.    #define MDI_INITIAL_MAX_DESKTOP      0x00000008L // --create the desktop as maximized
  145.    #define MDI_KEEP_SCROLLBARS          0x00000010L // --don't remove scroll bars when the document loses the focus
  146.    #define MDI_DISABLE_NEW_DOCUMENT     0x00000020L // --disables "new document" window menu entry
  147.    #define MDI_DISABLE_DESKTOP_POSITION 0x00000040L // --disables memory of desktop position and size
  148.    #define MDI_DISABLE_DOCUMENT_POSITION 0x0000080L // --disables memory of document position and size
  149.    #define MDI_ALWAYS_ON_RESIZE         0x00000100L // --performs tile, cascade always on desktop resize
  150.  
  151.    HWND    EXPENTRY MDICreateDocument   (PFNWP, HWND, ULONG, PCHAR, HMODULE, USHORT, PHWND, USHORT, USHORT, USHORT);
  152.                                         // PFNWP   : your document window procedure
  153.                                         // HWND    : handle to the desktop client window, as returned by MDICreateDesktop
  154.                                         // ULONG   : FCF_* flags for the document frame
  155.                                         // PCHAR   : initial document title
  156.                                         // HMODULE : module handle for resources (or NULL if in .EXE)
  157.                                         // USHORT  : id of resources
  158.                                         // PHWND   : pointer to area in which handle to document client is returned
  159.                                         // USHORT  : size of re-entrant document data
  160.                                         // USHORT  : size of re-entrant document instance data
  161.                                         // USHORT  : id of document frame
  162.  
  163.    MRESULT EXPENTRY MDIDesktopWndProc   (HWND, USHORT, MPARAM, MPARAM);
  164.                                         // HWND    : window handle
  165.                                         // USHORT  : message id
  166.                                         // MPARAM  : mp1
  167.                                         // MPARAM  : mp2
  168.  
  169.    MRESULT EXPENTRY MDIDocumentWndProc  (HWND, USHORT, MPARAM, MPARAM);
  170.                                         // HWND    : window handle
  171.                                         // USHORT  : message id
  172.                                         // MPARAM  : mp1
  173.                                         // MPARAM  : mp2
  174.  
  175.    VOID    EXPENTRY MDIInitialize       (HAB);
  176.                                         // HAB     : hab
  177.  
  178.  
  179. // End of MDI.H
  180. // ------------
  181.    #endif
  182.