home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Hutch / DOWNLOAD / Example1.exe / MDIDEMO / TOOLBAR.ASM < prev   
Encoding:
Assembly Source File  |  1999-05-17  |  2.9 KB  |  115 lines

  1. ; ########################################################################
  2.  
  3.     Do_ToolBar  PROTO :DWORD
  4.     SetBmpColor PROTO :DWORD
  5.  
  6.     include tbmacros.asm
  7.  
  8.     .data
  9.         hTbBmp        dd 0
  10.         hToolBar      dd 0
  11.  
  12.     .code
  13.  
  14. ; ########################################################################
  15.  
  16. Do_ToolBar proc hWin :DWORD
  17.  
  18.     ; ---------------------------------------
  19.     ; This proc works by using macros so that 
  20.     ; the code is easier to read and modify
  21.     ; ---------------------------------------
  22.  
  23.     LOCAL bSize :DWORD
  24.     LOCAL tbab  :TBADDBITMAP
  25.     LOCAL tbb   :TBBUTTON
  26.  
  27.     ; ------------------
  28.     ; The toolbar bitmap
  29.     ; ~~~~~~~~~~~~~~~~~~
  30.     ; You must supply a bitmap for the toolbar that has the 
  31.     ; correct number of the required images, each of the same
  32.     ; size and in the following strip bitmap form.
  33.     
  34.     ;  -------------------------------------
  35.     ;  |  1  |  2  |  3  |  4  |  5  |  6  |
  36.     ;  -------------------------------------
  37.  
  38.     ; ------------------------
  39.     ; Uncomment following when
  40.     ; bitmap has been created
  41.     ; ------------------------
  42.     ; invoke LoadBitmap,hInstance,750
  43.     ; mov hTbBmp,eax
  44.  
  45.     ; --------------------------------------------------
  46.     ; Set toolbar button dimensions here, width & height
  47.     ; --------------------------------------------------
  48.     Create_Tool_Bar 20, 20
  49.  
  50.     TBextraData     ; additional data for TBBUTTON structure
  51.  
  52.     ; -----------------------------------
  53.     ; Add toolbar buttons and spaces here
  54.     ; Syntax for the macro TBbutton is
  55.     ; TBbutton bmpID number, WM_COMMAND ID number
  56.     ; WM_COMMAND ID numbers start at 50
  57.     ; -----------------------------------
  58.     TBblank
  59.     TBbutton  0,  50
  60.     TBbutton  1,  51
  61.     TBbutton  2,  52
  62.     TBblank
  63.     TBbutton  3,  53
  64.     TBbutton  4,  54
  65.     TBbutton  5,  55
  66.     TBblank
  67.     TBbutton  6,  56
  68.     TBbutton  7,  57
  69.     TBbutton  8,  58
  70.  
  71.     ret
  72.  
  73. Do_ToolBar endp
  74.  
  75. ; ########################################################################
  76.  
  77. SetBmpColor proc hBitmap:DWORD
  78.  
  79.     LOCAL mDC       :DWORD
  80.     LOCAL hBrush    :DWORD
  81.     LOCAL hOldBmp   :DWORD
  82.     LOCAL hReturn   :DWORD
  83.     LOCAL hOldBrush :DWORD
  84.  
  85.       invoke CreateCompatibleDC,NULL
  86.       mov mDC,eax
  87.  
  88.       invoke SelectObject,mDC,hBitmap
  89.       mov hOldBmp,eax
  90.  
  91.       invoke GetSysColor,COLOR_BTNFACE
  92.       invoke CreateSolidBrush,eax
  93.       mov hBrush,eax
  94.  
  95.       invoke SelectObject,mDC,hBrush
  96.       mov hOldBrush,eax
  97.  
  98.       invoke GetPixel,mDC,1,1
  99.       invoke ExtFloodFill,mDC,1,1,eax,FLOODFILLSURFACE
  100.  
  101.       invoke SelectObject,mDC,hOldBrush
  102.       invoke DeleteObject,hBrush
  103.  
  104.       invoke SelectObject,mDC,hBitmap
  105.       mov hReturn,eax
  106.       invoke DeleteDC,mDC
  107.  
  108.       mov eax,hReturn
  109.  
  110.     ret
  111.  
  112. SetBmpColor endp
  113.  
  114. ; #########################################################################
  115.