comment $
//-----------------------------------------------------------------------------------//
//  Source code                                                                      //
//                                                                                   //
//  Written      by  Chib, amdtm                     http://www.xxcontrols.com       //
//                                                                                   //
//  FileName   : Office_2000.inc                                                     //
//  Description: libraries of functions for work with menu                           //
//  Version    : 1.00.000, January 1, 2004                                           //
//-----------------------------------------------------------------------------------//
$ 

; #########################################################################
;                                                                         ;
; Процедура обработки WM_DrawItem_Menu (стиль 2000)                            ;
;                                                                         ;
; #########################################################################

DrawItem_MenuDefault proc uses ebx

    LOCAL RctLeftBorder:RECT
    LOCAL mii         :MENUITEMINFO
    
; ======================================================================

assume ebx: ptr DRAWITEMSTRUCT

; выберем информацию о пункте меню    
    mov mii.cbSize, SIZEOF mii
    mov mii.fMask, MIIM_DATA or MIIM_BITMAP or MIIM_FTYPE ;or MIIM_STRING
    invoke GetMenuItemInfo, [ebx].hwndItem, [ebx].itemID, FALSE, ADDR mii
      
    mov eax, mii.fType
    and eax, MFT_SEPARATOR
            
   .if eax == MFT_SEPARATOR && mii.dwItemData          ; Пункт меню SEPARATOR
    
            invoke GetClipBox, [ebx].hdc, ADDR RctLeftBorder
            m2m RctLeftBorder.left, [ebx].rcItem.left
            m2m RctLeftBorder.right, [ebx].rcItem.right

;            mov eax, offset RctLeftBorder
            lea eax, RctLeftBorder
            push eax
            push [ebx].hdc
            push [ebx].hwndItem
            call mii.dwItemData    
    
    .endif
    
    ret
DrawItem_MenuDefault endp