-
Notifications
You must be signed in to change notification settings - Fork 0
/
wiq_2.inc
134 lines (76 loc) · 3.3 KB
/
wiq_2.inc
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
proc WindowProc uses ebx esi edi, hwnd,wmsg,wparam,lparam
local @@hdc:DWORD
mov edx, [wmsg]
cmp edx, WM_CREATE
jz .wmCreate
cmp edx, WM_TIMER
jz .wmTimer
cmp edx, WM_COMMAND
jz .wmCommand
cmp edx, WM_MOUSEMOVE
jz .wmMousemove
cmp edx, WM_PAINT
jz .wmPaint
cmp edx, WM_DESTROY
jz .wmdestroy
.defwndproc: invoke DefWindowProc,[hwnd],[wmsg],[wparam],[lparam]
ret
.wmCreate: include 'WM_Creat.inc'
.wmTimer: invoke wsprintfA, SBScoreLab + 14, intmask, [Timer_CLK]
invoke SendMessage, [hStatusBar], SB_SETTEXT, 1, SBScoreLab
inc [Timer_CLK]
cmp [Timer_CLK], 1
jnz .L_01
call INIT
.L_01: call START
invoke __Transit, 3, Transit
invoke InvalidateRect, [hwnd], 0, 0 ;заставляем главное окно перерисоваться...
ret
;-------------------------------------------------------
; Обработка событий от меню
;----------------------------------------
.wmCommand: mov dl, byte [wparam]
cmp dl, 1
jnz .L_04
invoke WinExec, UniMons, 1
.L_04: cmp dl, 20
jnz .L_05
invoke MessageBoxA, [hwnd], AboutText, AboutCaption, MB_ICONINFORMATION
.L_05: ret
;Кликнут пункт меню О программе..
; .cmdAbout: invoke MessageBoxA, [hwnd], AboutText, AboutCaption, MB_ICONINFORMATION
; ret
; ------------------------------------------------------
.wmMousemove: mov eax, [lparam] ; Отделяем младшее слово
shl eax, 16 ; Сначала сдвигаем влево на 16 bit
shr eax, 16 ; а затем обратно (вправо) на 16 bit
mov [xMove], eax ; после этих сдвигов в старших 16 bit остались только нули
mov eax, [lparam] ; Теперь отделяем старшее слово...
shr eax, 16 ; только один раз сдвигаем вправо на 16 bit
mov [yMove], eax ; Координата Y готова - слева 16 bit содержат одни нули Mouse_Y
invoke wsprintfA, Mouse_X_Y + 14, intmask, [xMove]
invoke wsprintfA, Mouse_Y + 6, intmask, [yMove]
ccall _lstrcat, Mouse_X_Y, Mouse_Y
invoke SendMessage, [hStatusBar], SB_SETTEXT, 2, Mouse_X_Y
ret
; ------------------------------------------------------
.wmPaint: ; invoke TextOut,[TmpDC] , 130, 200 ,_error, 1
invoke BeginPaint, [hwnd], PaintStruct ; ps
; 720, 480
invoke BitBlt, eax, 0, 0, 608, 486, [TmpDC], 0, 0, SRCCOPY
invoke EndPaint, [hwnd], PaintStruct ; ps
ret
; ------------------------------------------------------
.wmdestroy:
invoke DeleteObject, [hnewf] ; Удаляем нащ красивый шрифт
invoke DeleteObject, [TmpDC]
invoke DeleteObject, [TmpBmp]
invoke DeleteObject, [BlackPen]
invoke DeleteObject, [WhitePen]
invoke DeleteObject, [GreenPen]
invoke DeleteObject, [RedPen]
invoke PostQuitMessage,0
xor eax,eax
.finish: ret
endp
; CreateStatusBar hwnd ;ñîçäàíèå ñòðîêè ñîñòîÿíèÿ...