; #########################################################################

;     include files
;     ~~~~~~~~~~~~~
      include \masm32\include\WINDOWS.INC
      include \masm32\include\masm32.inc
      include \masm32\include\gdi32.inc
      include \masm32\include\user32.inc
      include \masm32\include\kernel32.inc
      include \masm32\include\comctl32.inc
      include \masm32\include\comdlg32.inc
      include \masm32\include\shell32.inc
      include \masm32\include\oleaut32.inc
      include \masm32\include\msimg32.inc
      include \masm32\include\debug.inc

;     libraries
;     ~~~~~~~~~
      includelib \masm32\lib\masm32.lib
      includelib \masm32\lib\gdi32.lib
      includelib \masm32\lib\user32.lib
      includelib \masm32\lib\kernel32.lib
      includelib \masm32\lib\comctl32.lib
      includelib \masm32\lib\comdlg32.lib
      includelib \masm32\lib\shell32.lib
      includelib \masm32\lib\oleaut32.lib
      includelib \masm32\lib\msimg32.lib
      includelib \masm32\lib\debug.lib
     
      include \masm32\MACROS\Macros.asm

$invoke MACRO Fun:REQ, A:VARARG
  IFB <A>
    invoke Fun
  ELSE
    invoke Fun, A
  ENDIF
  EXITM <eax>
        ENDM
        
IF_MSG macro WMsg:REQ, DoJmp:REQ
   cmp uMsg, WMsg
   jz  DoJmp
endm

WM_CASE macro reg,msgs
   irp msg,<msgs>
      cmp reg,WM_&msg
      je @@&msg
   endm
endm

HIWORD macro bigword    ; Возврвщает старшее слово 
   mov  eax,bigword
   shr  eax,16         ;; Get high word
endm

; #########################################################################

        ;=================
        ; Local prototypes
        ;=================
        WndProc          PROTO :HWND, :UINT, :WPARAM, :LPARAM
        ChildWndProc     PROTO :HWND, :UINT, :WPARAM, :LPARAM	
        RegisterWinClass PROTO :DWORD, :DWORD, :HICON, :HCURSOR, :HBRUSH
        MsgLoop          PROTO
        Main             PROTO
        AboutProc        PROTO :HWND, :UINT, :WPARAM, :LPARAM

        wsprintfA        PROTO C :DWORD,:VARARG
        wsprintf         equ <wsprintfA>
        

    .data
        szDisplayName               DB          "XXMenu!!!",0
        szClassMDI		      DB	        "MDICLIENT",0
        Document		      DB	        "Document",0
        StyleMenu		      DWORD       STYLE_OFFICE_2000

    .data?
        hInstance                   HINSTANCE   ?
        hCursor                     HCURSOR     ?
        hIcon		      HICON       ?
        sWid                        DWORD       ?
        sHgt                        DWORD       ?
        hWnd                        HWND        ?
        hWndClient	                HWND        ?
        hMenu                       HMENU       ?
        hSysMenu                    HMENU       ?
        hContextMenu                HMENU       ?
        hMenu_AddDocNumber	      HMENU       ?	           
        hImageList                  HIMAGELIST  ?
        h_Accel		      HACCEL      ?
        
    .const

        MAINMENU                    equ         600
        
        IDM_FILE_NEW                equ         1002
        IDM_FILE_OPEN               equ         1004
        IDM_FILE_SAVE               equ         1006
        IDM_FILE_SAVE_AS            equ         1008
        IDM_FILE_PRINT              equ         1010
        IDM_FILE_PRINT_PREVIEW      equ         1012
        IDM_FILE_PRINT_SETUP        equ         1014
        IDM_FILE_RECENT_FILE        equ         1016
        IDM_FILE_CLOSE	      equ	        1017		
        IDM_FILE_APP_EXIT           equ         1018
        IDM_EDIT_UNDO               equ         1020
        IDM_EDIT_CUT                equ         1022
        IDM_EDIT_COPY               equ         1024
        IDM_EDIT_PASTE              equ         1026
        IDM_EDIT_DELETE             equ         1028
        
        IDM_EDIT_BMP                equ         1080
        
        IDM_VIEW_TOOLBARS           equ         1030
        IDM_VIEW_TOOLBARS_STANDARD  equ         1032
        IDM_VIEW_TOOLBARS_CUSTOMIZE equ         1034
        IDM_VIEW_SATATUSBAR         equ         1036
        IDM_VIEW_STYLE_DEFAULT      equ         1040
        IDM_VIEW_STYLE_OFFICE_2000  equ         1042
        IDM_VIEW_STYLE_OFFICE_XP    equ         1044
        IDM_VIEW_STYLE_XNET	      equ         1045
        IDM_WINDOW_CASCADE	      equ	        1046
        IDM_WINDOW_TILEHORZ	      equ	        1048
        IDM_WINDOW_TILEVERT	      equ	        1050
        IDM_WINDOW_ARRANGE	      equ	        1052
        IDM_HELP_ABOUT_XX	      equ         1060
        
        IDM_NOT_STANDART_CHECK_ITEM equ	        1072
        
        IDB_BITMAP1                 equ         100
                
        ACC	                equ         110
        
        ID_CHILDWINDOW	      equ	        2000	;An ID that is different than all menu ids.
; ########################### Inserted modules ############################
 
        include 		XXControls.inc
        includelib 		XXControls.lib
        
        ; #? - About #
        
        include 		XXAbout.inc
        includelib 		XXAbout.lib 

; #########################################################################