home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Hutch / DOWNLOAD / Example2.exe / SPLASH / TBMACROS.ASM < prev    next >
Encoding:
Assembly Source File  |  1999-06-08  |  2.0 KB  |  71 lines

  1.       ; ---------------------------
  2.       ; macros for creating toolbar
  3.       ; ---------------------------
  4.  
  5.       TBextraData MACRO
  6.         mov tbb.fsState,   TBSTATE_ENABLED
  7.         mov tbb.dwData,    0
  8.         mov tbb.iString,   0
  9.       ENDM
  10.  
  11.       ; ------------------------------
  12.  
  13.       TBbutton MACRO bID, cID
  14.         mov tbb.iBitmap,   bID  ;; button  ID number
  15.         mov tbb.idCommand, cID  ;; command ID number
  16.         mov tbb.fsStyle,   TBSTYLE_BUTTON
  17.         invoke SendMessage,hToolBar,TB_ADDBUTTONS,1,ADDR tbb
  18.       ENDM
  19.  
  20.       ; ------------------------------
  21.  
  22.       TBblank MACRO
  23.         mov tbb.iBitmap,   0
  24.         mov tbb.idCommand, 0
  25.         mov tbb.fsStyle,   TBSTYLE_SEP
  26.         invoke SendMessage,hToolBar,TB_ADDBUTTONS,1,ADDR tbb
  27.       ENDM
  28.  
  29.       ; ------------------------------
  30.  
  31.       Create_Tool_Bar MACRO Wd, Ht
  32.  
  33.         szText tbClass,"ToolbarWindow32"
  34.  
  35.         invoke CreateWindowEx,0,
  36.                               ADDR tbClass,
  37.                               ADDR szDisplayName,
  38.                               WS_CHILD or WS_VISIBLE,
  39.                               0,0,500,40,
  40.                               hWin,NULL,
  41.                               hInstance,NULL
  42.  
  43.                               ;; or TBSTYLE_FLAT
  44.  
  45.         mov hToolBar, eax
  46.     
  47.         invoke SendMessage,hToolBar,TB_BUTTONSTRUCTSIZE,sizeof TBBUTTON,0
  48.     
  49.         ;; ---------------------------------------
  50.         ;; Put width & height of bitmap into DWORD
  51.         ;; ---------------------------------------
  52.         mov  ecx,Wd  ;; loword = bitmap Width
  53.         mov  eax,Ht  ;; hiword = bitmap Height
  54.         shl  eax,16
  55.         mov  ax, cx
  56.  
  57.         mov bSize, eax
  58.     
  59.         invoke SendMessage,hToolBar,TB_SETBITMAPSIZE,0,bSize
  60.     
  61.         invoke SetBmpColor,hTbBmp
  62.         mov hTbBmp,eax
  63.     
  64.         mov tbab.hInst, 0
  65.         m2m tbab.nID,   hTbBmp
  66.         invoke SendMessage,hToolBar,TB_ADDBITMAP,12,ADDR tbab
  67.     
  68.         invoke SendMessage,hToolBar,TB_SETBUTTONSIZE,0,bSize
  69.       ENDM
  70.  
  71.