
            include  \MASM32V1\include\Windows.inc
            include  \MASM32V1\include\user32.inc
            include  \MASM32V1\include\kernel32.inc
            include  \MASM32V1\include\gdi32.inc
            include  \MASM32V1\include\comctl32.inc
            include  \MASM32V1\include\comdlg32.inc
            include  \MASM32V1\include\advapi32.inc
            include  \MASM32V1\include\shell32.inc
            include   \MASM32V1\include\ole32.inc
            include  \MASM32V1\include\imagehlp.inc

include  \MASM32V1\include\DSPMACRO.asm

         includelib  \MASM32V1\lib\user32.lib
         includelib  \MASM32V1\lib\kernel32.lib
         includelib  \MASM32V1\lib\gdi32.lib
         includelib  \MASM32V1\lib\comctl32.lib
         includelib  \MASM32V1\lib\comdlg32.lib
         includelib  \MASM32V1\lib\advapi32.lib
         includelib  \Masm32V1\lib\shell32.lib
         includelib  \Masm32v1\LIB\ole32.lib
         includelib  \MASM32V1\LIB\imagehlp.LIB

TBSep    MACRO hTool
           mov     tbb.iBitmap, 0
           mov     tbb.idCommand, 0
           mov     tbb.fsState, TBSTATE_ENABLED
           mov     tbb.fsStyle, TBSTYLE_SEP
        INVOKE     SendMessage, hTool, TB_ADDBUTTONS, 1, addr tbb
          ENDM

TBButt   MACRO hTool, BmpID, CmdID, Text
           mov     tbb.iBitmap, BmpID    ; Button image number
           mov     tbb.idCommand, CmdID  ; Command ID number
           mov     tbb.fsState, TBSTATE_ENABLED
           mov     tbb.fsStyle, TBSTYLE_BUTTON
           mov     tbb.dwData, 0
           mov     tbb.iString, Text
        INVOKE     SendMessage, hTool, TB_ADDBUTTONS, 1, addr tbb
          ENDM

MOVmd    MACRO Var1, Var2
         push     Var2
          pop     Var1
         ENDM

; Constants
ID_TREEVIEW    equ 1002h
ID_LISTVIEW    equ 1003h

IDM_NEW        equ 1001
IDM_OPEN       equ 1002
IDM_SAVE       equ 1003
IDM_SAVEAS     equ 1004
IDM_SAVEALL    equ 1005
IDM_PRINT      equ 1006
IDM_CLOSETAB   equ 2000
IDM_EXIT       equ 2001
IDM_CUT        equ 1007
IDM_COPY       equ 1008
IDM_PASTE      equ 1009
IDM_DEL        equ 1010
IDM_UNDO       equ 1011
IDM_REDO       equ 1012
IDM_SELALL     equ 1013
IDM_VIEW       equ 1014
IDM_CHOOSEF    equ 1015
IDM_CHOOSEC    equ 1016
IDM_BACKGRN    equ 1017
IDM_FIND       equ 1018
IDM_FINDN      equ 1019
IDM_FINDP      equ 1020
IDM_REPLACE    equ 1021

TCS_SCROLLOPPOSITE    equ  0001h
TCS_BOTTOM            equ  0002h
TCS_FLATBUTTONS       equ  0008h
TCS_HOTTRACK          equ  0040h
TCS_EX_FLATSEPARATORS equ  0001h

TVM_SETBKCOLOR        equ  TV_FIRST + 29
TVM_SETTEXTCOLOR      equ  TV_FIRST + 30
TVM_SETLINECOLOR      equ  TV_FIRST + 40

;---------------------------------------
; Globals
externdef          hWndTree:DWORD
externdef          hWndList:DWORD
externdef          hMyComputer:DWORD
externdef          pShellMalloc:LPMALLOC
externdef          Loaded:DWORD
externdef          hWnd:DWORD
externdef          hDrives:DWORD
externdef          hItem:DWORD
externdef          FileName:BYTE
externdef          PathName:BYTE
externdef          WorkBuff:BYTE
externdef          szDrvLet:BYTE
externdef          szLoadPath:BYTE

TV_OBJDATA struct
      pidlRel      DWORD  ?
      pidlFull     DWORD  ?
      pshfParent   DWORD  ?
TV_OBJDATA ends

LPTV_OBJDATA       typedef ptr TV_OBJDATA
LPPTV_OBJDATA      typedef ptr LPTV_OBJDATA
 
;---------------------------------------------------------------------
; General Functions
WinMain            PROTO :DWORD, :DWORD, :DWORD, :DWORD
RichEditProc       PROTO :DWORD, :DWORD, :DWORD, :DWORD
SplitBarProc       PROTO :DWORD, :DWORD, :DWORD, :DWORD
CreateTab          PROTO :DWORD
FindReplace        PROTO :DWORD, :DWORD, :DWORD, :DWORD
Find               PROTO :DWORD, :DWORD, :DWORD, :DWORD, :DWORD

InitTreeView       PROTO :DWORD, :DWORD
TreeViewNotify     PROTO :DWORD, :DWORD
UpdateTreeView     PROTO :DWORD, :DWORD, :DWORD, :DWORD
InitListView       PROTO :DWORD, :DWORD
DisplayFileName    PROTO
ReadTheFile        PROTO
TreeBranch         PROTO :DWORD
LoadListView       PROTO :DWORD, :DWORD
ListViewSort       PROTO :DWORD, :DWORD, :DWORD
BaseAscii          PROTO :DWORD, :DWORD, :DWORD, :DWORD, :DWORD, :DWORD, :DWORD

; Shell Namespace helper functions
GetIcon            PROTO :DWORD, :DWORD

; Item Id List functions
IDList_GetSize     PROTO :DWORD
IDList_Combine     PROTO :DWORD, :DWORD
IDList_CopyItem    PROTO :DWORD
