	SECTION _TEXT align=1 CLASS=CODE USE32
	SECTION _DATA align=16 CLASS=DATA USE32
	SECTION _BSS align=16 CLASS=BSS USE32
	SECTION _CONST align=16 CLASS=CONST USE32
	SECTION _STRING align=4 CLASS=STRING USE32
	SECTION cstartup align=4 CLASS=INITDATA USE32
	SECTION crundown align=4 CLASS=EXITDATA USE32
	SECTION cppinit  align=4 CLASS=CPPINIT USE32
	SECTION cppexit  align=4 CLASS=CPPEXIT USE32
	GROUP DGROUP _DATA _BSS _CONST _STRING

SECTION _TEXT
[GLOBAL	_BoxProc]
;
; Line 5:	int BoxProc(WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
;
_BoxProc:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 08H
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
	MOV	EBX,DWORD _classdefs
L_2:
;
; Line 6:	{
;
;
; Line 8:	CTLWINDOW *ct = GetControl(wnd);
;
	MOV	EDI,DWORD [ESI+0108H]
;
; Line 9:	if (ct != NULL)    {
;
	TEST	EDI,EDI
	JE	NEAR	L_3
;
; Line 10:	switch (msg)    {
;
	MOV	EAX,DWORD [EBP+0CH]
	CMP	EAX,BYTE 0AH
	JE	SHORT	L_11
	JA	SHORT	L_12
	CMP	EAX,BYTE 09H
	JE	SHORT	L_8
	JA	SHORT	L_6
	CMP	EAX,BYTE 08H
	JE	SHORT	L_7
	JMP	SHORT	L_6
L_12:
	CMP	EAX,BYTE 027H
	JE	SHORT	L_10
	JA	SHORT	L_6
	CMP	EAX,BYTE 024H
	JE	SHORT	L_9
	JMP	SHORT	L_6
L_7:
;
; Line 12:	case PAINT:
;
L_8:
;
; Line 13:	return FALSE;
;
	MOV	EAX,00H
	JMP	SHORT	L_1
L_9:
;
; Line 15:	case BUTTON_RELEASED:
;
L_10:
;
; Line 16:	return SendMessage(GetParent(wnd), msg, p1, p2);
;
	PUSH	DWORD [EBP+014H]
	PUSH	DWORD [EBP+010H]
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	DWORD [ESI+03CH]
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	SHORT	L_1
L_11:
;
; Line 18:	rtn = BaseWndProc(BOX, wnd, msg, p1, p2);
;
	PUSH	DWORD [EBP+014H]
	PUSH	DWORD [EBP+010H]
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	ESI
	MOV	EAX,DWORD [EBX+078H]
	IMUL	EAX,BYTE 0CH
	LEA	EAX,[EBX+EAX+00H]
	CALL	DWORD [EAX+04H]
	ADD	ESP,BYTE 010H
	MOV	DWORD [EBP-04H],EAX
;
; Line 19:	if (ct != NULL && ct->itext != NULL)
;
	TEST	EDI,EDI
	JE	SHORT	L_13
	CMP	DWORD [EDI+018H],BYTE 00H
	JE	SHORT	L_13
;
; Line 20:	writeline(wnd, ct->itext, 1, 0, FALSE);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 01H
	PUSH	DWORD [EDI+018H]
	PUSH	ESI
	CALL	_writeline
	ADD	ESP,BYTE 014H
L_13:
;
; Line 21:	return rtn;
;
	MOV	EAX,DWORD [EBP-04H]
	JMP	SHORT	L_1
L_6:
;
; Line 23:	break;
;
	JMP	SHORT	L_5
L_5:
L_3:
;
; Line 26:	return BaseWndProc(BOX, wnd, msg, p1, p2);
;
	PUSH	DWORD [EBP+014H]
	PUSH	DWORD [EBP+010H]
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	ESI
	MOV	EAX,DWORD [EBX+078H]
	IMUL	EAX,BYTE 0CH
	LEA	EAX,[EBX+EAX+00H]
	CALL	DWORD [EAX+04H]
	ADD	ESP,BYTE 010H
L_1:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
SECTION _CONST

SECTION _TEXT
[EXTERN	_writeline]
[EXTERN	_classdefs]
[EXTERN	_SendMessage]
