首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 嵌入开发 > 汇编语言 >

初学汇编 遇到有关问题

2012-03-13 
初学汇编 遇到问题,请教大家_ProcWinMainprocuses ebx edi esi,hWnd,uMsg,wParam,lParamlocal@hDc:HDCloca

初学汇编 遇到问题,请教大家
_ProcWinMainprocuses ebx edi esi,hWnd,uMsg,wParam,lParam
local@hDc:HDC
local@hbRush:HBRUSH

moveax,uMsg
;*********************************************************
.if eax==WM_RBUTTONDOWN
call_Quit
;***********************************************************
.elseifeax ==WM_CREATE
invokeCreateWindowEx,NULL,addr szEdit,\;创建Edit
  addr szPass,WS_CHILD or WS_VISIBLE,\
  0,0,65,18,hWnd,1,hInstance,NULL
movhwndedit,eax
.elseifeax == WM_CTLCOLOREDIT;我想在这里设置Edit的背景颜色和字体颜色,这样没能成功
moveax,wParam
mov@hDc,eax
invokeCreateSolidBrush,00FF0000H
movhbRush,eax
invokeSetTextColor,addr @hDc,000000H
invokeSetBkColor,addr @hDc,00FFFFH
ret
.elseif eax ==WM_CLOSE
invokeDestroyWindow,hWinMain
invoke PostQuitMessage,NULL
.else
invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
.endif
;********************************************************************
xoreax,eax
ret

_ProcWinMainendp

[解决办法]
没这样用过,但MSDN上说“If an application processes this message, it must return the handle of a brush. The system uses the brush to paint the background of the edit control. ”,

Assembly code
invoke SetTextColor,addr @hDc,000000Hinvoke SetBkColor,addr @hDc,00FFFFHret 

热点排行