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