This repository has been archived by the owner on Jan 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGraphWin.inc
184 lines (151 loc) · 4.25 KB
/
GraphWin.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
.NOLIST
; GraphWin.inc - Include file for Graphics Windows Application
; By Kip Irvine and Tom Joyce.
; Most of the definitions found here are from three header files:
; WinUser.h, WinBase.h, and Winnt.h
; Last update: 6/10/2005
;------------------ Structures ----------------
POINT STRUCT
X DWORD ?
Y DWORD ?
POINT ENDS
RECT STRUCT
left DWORD ?
top DWORD ?
right DWORD ?
bottom DWORD ?
RECT ENDS
MSGStruct STRUCT
msgWnd DWORD ?
msgMessage DWORD ?
msgWparam DWORD ?
msgLparam DWORD ?
msgTime DWORD ?
msgPt POINT <>
MSGStruct ENDS
WNDCLASS STRUC
style DWORD ?
lpfnWndProc DWORD ?
cbClsExtra DWORD ?
cbWndExtra DWORD ?
hInstance DWORD ?
hIcon DWORD ?
hCursor DWORD ?
hbrBackground DWORD ?
lpszMenuName DWORD ?
lpszClassName DWORD ?
WNDCLASS ENDS
;-------------- Function Prototypes ------------------------
CreateWindowExA PROTO, ; create and register a window class
exWinStyle:DWORD,
className:PTR BYTE,
winName:PTR BYTE,
winStyle:DWORD,
X:DWORD,
Y:DWORD,
rWidth:DWORD,
rHeight:DWORD,
hWndParent:DWORD,
hMenu:DWORD,
hInstance:DWORD,
lpParam:DWORD
DefWindowProcA PROTO, ; default Windows message handler
hWnd:DWORD,
locMsg:DWORD,
wParam:DWORD,
lParam:DWORD
DispatchMessageA PROTO, ; dispatch a message to the application
pMsg:PTR BYTE
ExitProcess PROTO, ; exit the current process
exitCode:DWORD
GetMessageA PROTO,
lpMsg:PTR BYTE,
hWnd:DWORD,
firstMsg:DWORD,
lastMsg:DWORD
GetModuleHandleA PROTO,
pString:PTR BYTE
GetWindowDC PROTO, ; get the current window's device context
hWind:DWORD
GetWindowRect PROTO, ; get the current window's rectangle
hWind:DWORD,
pRect:PTR RECT
LoadCursorA PROTO, ; load a cursor resource
hInstance:DWORD,
pString:PTR BYTE
LoadIconA PROTO, ; loan an icon resource
hInstance:DWORD,
pString:PTR BYTE
PostQuitMessage PROTO, ; tell Windows to terminate the app
exitCode:DWORD
RegisterClassA PROTO, ; register a new window class
pWndClass:PTR WNDCLASS
ShowWindow PROTO, ; show a window
hWnd:DWORD,
showState:DWORD
UpdateWindow PROTO, ; draw(redraw) a window
hWnd:DWORD
Comment !
SelectObject PROTO, ; GDI32.LIB
hdc:DWORD
hGDIobject:DWORD
DeleteObject PROTO, ; GDI32.LIB
hGDIobject:DWORD
!
; Redefine Win32 Names to standard API names.
GetModuleHandle TEXTEQU <GetModuleHandleA>
LoadCursor TEXTEQU <LoadCursorA>
LoadIcon TEXTEQU <LoadIconA>
RegisterClass TEXTEQU <RegisterClassA>
CreateWindowEx TEXTEQU <CreateWindowExA>
DispatchMessage TEXTEQU <DispatchMessageA>
GetMessage TEXTEQU <GetMessageA>
DefWindowProc TEXTEQU <DefWindowProcA>
FormatMessage TEXTEQU <FormatMessageA>
; RegisterClass Constants (from Winuser.h)
COLOR_WINDOW = 5 ; std window color
COLOR_BACKGROUND = 2 ; 2=blue F=gray
IDI_APPLICATION = 32512 ; application icon
IDC_ARROW = 07f00h ; mouse cursor--arrow
CW_USEDEFAULT = 80000000h ; default window size & position
; Window Style Constants
WS_OVERLAPPED = 00000000h
WS_BORDER = 00800000h
WS_DLGFRAME = 00400000h
WS_SYSMENU = 00080000h
WS_MAXIMIZEBOX = 00010000h
WS_MINIMIZEBOX = 00020000h
WS_THICKFRAME = 00040000h
WS_CAPTION = WS_BORDER+WS_DLGFRAME
WS_VISIBLE = 10000000h
; Window show constants
SW_SHOW = 05h
; Window Messages
WM_CLOSE = 0010h ; close window
WM_CREATE = 01h ; create window
WM_LBUTTONDOWN = 0201h ; left mouse button down
COMMENT @
MB_ICONERROR = 010h ; stop sign icon
MB_ICONHAND = 10h
MB_ICONQUESTION = 20h
MB_ICONEXCLAMATION = 30h
MB_ICONASTERISK = 40h
MB_USERICON = 80h
MB_ICONWARNING = MB_ICONEXCLAMATION
MB_ICONERROR = MB_ICONHAND
MB_ICONINFORMATION = MB_ICONASTERISK
MB_ICONSTOP = MB_ICONHAND
; Message Box Buttons
MB_OK = 0
MB_OKCANCEL = 1
MB_ABORTRETRYIGNORE = 2
MB_YESNOCANCEL = 3
MB_YESNO = 4
MB_RETRYCANCEL = 5
MB_CANCELTRYCONTINUE = 6
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@2
;Constants created by Irvine:
NULL EQU 0
MAIN_WINDOW_STYLE = WS_VISIBLE+WS_DLGFRAME+WS_CAPTION+WS_BORDER+WS_SYSMENU \
+WS_MAXIMIZEBOX+WS_MINIMIZEBOX+WS_THICKFRAME
.LIST