win32的键盘输入问题
写的一个win32的计算器代码 结果键盘输入用不了 _ProcDlgMain PROC USES EBX EDI ESI , hWnd, wMsg, wParam, lParam
MOV EAX, wMsg
.IF EAX == WM_CLOSE ;关闭程序
INVOKE EndDialog, hWnd, NULL
.ELSEIF EAX == WM_INITDIALOG ;初始化程序
INVOKE LoadIcon, hInstance, ICO_MAIN
INVOKE SendMessage, hWnd, WM_SETICON, ICON_BIG, EAX
INVOKE GetDlgItem, hWnd, IDC_EDIT
INVOKE SetWindowText, EAX, ADDR BUF+1
.ELSEIF EAX == WM_CHAR ;响应键盘操作
MOV EAX, wParam
.IF ( EAX <= '9' && EAX >= '0' )
ADD EAX, IDC_0 - '0'
INVOKE _ProcDlgMain, hWnd, WM_COMMAND, EAX, 0
.ELSEIF EAX == '.'
INVOKE _ProcDlgMain, hWnd, WM_COMMAND, IDC_DOT, 0
.ELSEIF EAX == '+'
INVOKE _ProcDlgMain, hWnd, WM_COMMAND, IDC_ADD, 0
.ELSEIF EAX == '-'
INVOKE _ProcDlgMain, hWnd, WM_COMMAND, IDC_SUB, 0
.ELSEIF EAX == '*'
INVOKE _ProcDlgMain, hWnd, WM_COMMAND, IDC_MUL, 0
.ELSEIF EAX == '/'
INVOKE _ProcDlgMain, hWnd, WM_COMMAND, IDC_DIV, 0
.ELSEIF EAX == '='
INVOKE _ProcDlgMain, hWnd, WM_COMMAND, IDC_EQU, 0
.ENDIF
.ELSEIF EAX == WM_COMMAND ;响应按键
。。。。
。。。。
.ELSE
MOV EAX, FALSE
RET
.ENDIF
MOV EAX, TRUE
RET
_ProcDlgMain ENDP
;主程序
START:
FINIT
INVOKE GetModuleHandle,NULL ;取得模块句柄
MOV hInstance,EAX ;保存到hInstance
FINIT
INVOKE DialogBoxParam, hInstance, DLG_MAIN, NULL, OFFSET _ProcDlgMain, NULL
MOV hDlg, EAX
FINIT
INVOKE ExitProcess,NULL
END START
求指导……