home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l430 / 1.ddi / CHAP6.ZIP / USEROBJ.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-11  |  6.5 KB  |  188 lines

  1. /* 
  2. USEROBJ.H -- USER-related structures
  3.  
  4. Local object types:
  5.     CLASS
  6.     WND
  7.     MENU
  8.     ITEM
  9.     PROPERTY
  10.     DCE
  11.         
  12. from Chapter 6 of "Undocumented Windows"  (Addison-Wesley, 1992)
  13. by Andrew Schulman, Dave Maxey and Matt Pietrek.
  14.  
  15. Copyright (c) Dave Maxey 1992
  16. */
  17.  
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21.  
  22. #define        CLASS_MAGIC            0x4B4E        // NK
  23. #define        MENU_MAGIC            0x554D        // MU
  24.  
  25.  
  26. /* === UNDOCUMENTED STRUCTURES === */
  27.  
  28. // Window class structure held in USER's near heap
  29.  
  30. typedef struct {
  31.         HANDLE    hcNext;            // 00h Next entry in the class linked list
  32.         WORD    wSig;            // 02h Should contain 0x4b4e ("NK")
  33.         ATOM    atomCls;        // 04h Atom for class name string (USER heap)
  34.         HANDLE    hDCE;            // 06h Handle to DCE when CS_CLASSDC, or NULL
  35.         WORD    cClsWnds;        // 08h Count of windows with this class
  36.         WNDCLASS wc;            // 0Ah Incomplete copy from RegisterClass
  37.         WORD    eExtra[1];        // 24h Class extra user data from here
  38.         } CLASS, NEAR * HCLASS;
  39.  
  40. // Window structure for 3.0 held in USER's local heap
  41.  
  42. typedef struct {
  43.         HWND    hwndNext;        // 00h Next in top level window linked list
  44.         HWND    hwndChild;        // 02h first child window
  45.         HCLASS    hClass;            // 04h Class info for this window
  46.         HANDLE    hProp;            // 06h Handle of property list
  47.         HWND    hwndLastActive;    // 08h hwnd of last active popup
  48.         HANDLE    hScroll;        // 0Ah USER local handle - used for scrolling?
  49.         HANDLE    hmemTaskQ;        // 0Ch Window task/application message queue
  50.         HRGN    hrgnUpdate;        // 0Eh Current invalid region for window
  51.         HANDLE    hDCE;            // 10h handle to DCE when CS_OWNDC, or NULL
  52.         HMENU    hmenuSystem;    // 12h System menu handle
  53.         HWND    hwndOwner;        // 14h Owning application window
  54.         RECT    rectWindow;        // 16h Non-client window coordinates
  55.         RECT    rectClient;        // 1Eh Client window coordinates
  56.         HPALETTE hPalette;        // 26h Logical palette to be used during paint
  57.         WORD    wFlags;            // 28h bits 9/10 used in WM_USER+260 drag/drop
  58.         DWORD    rgfExStyle;        // 2Ah
  59.         DWORD    rgfStyle;        // 2Eh
  60.         WORD    wID_Menu;        // 32h ID if control otherwise menu handle
  61.         HANDLE    hText;            // 34h handle of window text in text heap
  62.         HWND    hwndParent;        // 36h for child windows
  63.         HANDLE    hInstance;        // 38h application instance handle
  64.         FARPROC    lpfnWndProc;    // 3Ah ProcInstance of WndProc for window
  65.                                 // 3Eh user data area (array size >= 0 )
  66.         } WND_3_0 /* , NEAR * HWND */ ;
  67.         
  68.  
  69. // Window structure for 3.1 held in USER's local heap
  70. // Note that, for no apparent reason, all fields in the structure
  71. // apart from the first two, which provide navigation through the
  72. // window hierarchy, have changed position, including those accessible
  73. // by GetWindowWord/GetWindowLong.
  74.  
  75. typedef struct {
  76.         HWND    hwndNext;        // 00h Next in top level window linked list
  77.         HWND    hwndChild;        // 02h first child window
  78.         HWND    hwndParent;        // 04h
  79.         HWND    hwndOwner;        // 06h for child windows
  80.         RECT    rectWindow;        // 08h Non-client window coordinates
  81.         RECT    rectClient;        // 10h Client window coordinates
  82.         HANDLE    hmemTaskQ;        // 18h Window task/application message queue
  83.         HRGN    hrgnUpdate;        // 1Ah
  84.         HCLASS    hClass;            // 1Ch Class info for this window
  85.         HANDLE    hInstance;        // 1Eh application instance handle
  86.         FARPROC    lpfnWndProc;    // 20h ProcInstance of WndProc for window
  87.         DWORD    dwFlags;        // 24h
  88.         DWORD    rgfStyle;        // 28h
  89.         DWORD    rgfExStyle;        // 2Ch
  90.         WORD    wID_Menu;        // 30h ID if control otherwise menu handle
  91.         HWND    hText;            // 32h handle of window text in text heap
  92.         HANDLE    hScroll;        // 34h USER local handle used for scrolling
  93.         HANDLE    hProp;            // 36h handle of property list
  94.         HWND    hwndLastActive;    // 38h hwnd of last active popup
  95.         HMENU    hmenuSystem;    // 3Ah System menu handle
  96.                                 // 3Ch user data area
  97.         } WND_3_1 /* , NEAR * HWND */ ;
  98.  
  99.  
  100. // Menu item substructure valid for 3.0 and 3.1
  101. typedef struct {
  102.         WORD    wFlags;            // 00h Flags
  103.         WORD    hIDorPopup;        // 02h Item ID or popup menu handle
  104.         RECT    rectCapture;    // 04h Item area in screen coords. 
  105.         WORD     xTab;            // 0Ch tab position in string
  106.         HANDLE    hCheckedBmp;    // 0Eh Bitmap to use for checked
  107.         HANDLE    hUncheckedBmp;    // 10h Bitmap to use for unchecked
  108.         HANDLE    hStrOrBmp;        // 12h Handle to string or bitmap
  109.         WORD    xULStart;        // 14h Start of underline
  110.         WORD    cxULLen;        // 16h Length of underline (== width of char)
  111.         WORD    cbItemLen;        // 18h Length of item if string or NULL
  112.         } ITEM, FAR *LPITEM;                        // 1Ah Total
  113.  
  114.  
  115. // Menu structure
  116. typedef struct {
  117.         WORD    wFlags;            // 00h flags
  118.         WORD    iCurrSel;        // 02h Currently selected item or -1
  119.         WORD    iCurrPopup;        // 04h Current popup or -1 if curr not popup
  120.         WORD    cbMenu;            // 06h Size of this structure + items
  121.         WORD    cxWidth;        // 08h Menu width in pixels
  122.         WORD    cyHeight;        // 0Ah Menu height in pixels
  123.         WORD    cItems;            // 0Ch Count of items following
  124.         HWND    hwndOwner;        // 0Eh Owning window
  125.                                 // 10h start of array of ITEMs
  126.         } MENU_3_0 /* , *HMENU */ ;
  127.  
  128.  
  129. typedef struct {
  130.         HMENU    hmenuNext;        // 00h Next in linked list of menus
  131.         WORD    wFlags;            // 02h flags
  132.         WORD    wMagic;            // 04h Signature/magic (0x554D == 'MU')
  133.         HANDLE    hTaskQ;            // 06h Owning task queue handle ???
  134.         WORD    cxWidth;        // 08h Width (0 if Sys Menu box)
  135.         WORD    cyHeight;        // 0Ah Height (0 if Sys Menu box)
  136.         WORD    cItems;            // 0Ch Count of items
  137.         HWND    hwndOwner;        // 0Eh Owning window
  138.         HANDLE    hItems;            // 10h hItems
  139.         WORD    w12;            // 12h ??? (Usually 0)
  140.                                     // 14h Total 
  141.         } MENU_3_1 /* , *HMENU */ ;
  142.  
  143. typedef void FAR *LPMENU;
  144.  
  145.  
  146.  
  147. // Window Properties structures
  148. typedef struct {
  149.         ATOM    atomID;            // 00h Atom containing property identifier
  150.         HANDLE    hData;            // 02h User supplied data handle
  151.         WORD    wFlags;            // 04h Flags:
  152.         } PROPERTY;                //        0x000B = Always set...
  153.                                 //        0x0010 = Internal property
  154.                                 //        0x0100 = Identifier was string
  155.                                 //                    not atom
  156.         
  157.  
  158. typedef struct {
  159.         WORD    cProps;            // 00h Count of properties in array at 02h
  160.                                 // 02h Start of array of PROPERTY structures
  161.         } PROPLIST;
  162.     
  163.     
  164.     
  165.  
  166. // USER DC Entry structure
  167. typedef struct {
  168.         HANDLE    hdceNext;        // 00h Next in linked list of DCEs
  169.         HWND    hwnd;            // 02h Currently owning window
  170.         HDC        hDC;            // 04h HDC that this entry refers to
  171.         BYTE    byFlags;        // 06h Flags:
  172.                                 //         0x01 - For client area use
  173.                                 //        0x02 - For window area use
  174.                                 //        Others ???
  175.         BYTE    byInUse;        // 07h 0 = free, 1 = in use 
  176.         BYTE    byDirty;        // 08h 1 = window needs update, 0 = does not
  177.         BYTE    by0A;            // 09h ???
  178.         WORD    xOrigin;        // 0Ah DC Origin X
  179.         WORD    yOrigin;        // 0Ch DC Origin Y
  180.         HWND    hwndTop;        // 0Eh Parent window (also using this entry?)
  181.         HRGN    hVisRgn;        // 10h Visible region
  182.         } DCE, *HDCE;                // 12h TOTAL
  183.         
  184.  
  185. #ifdef __cplusplus
  186. }
  187. #endif
  188.