字符窜的小问题
用invoke GetWindowText,hWnd,addr @buf,sizeof @buf得到的buf如何遍历@buf字符窜的每一个字母
.386 .Model Flat,StdCall Option Casemap :None Include Windows.inc Include User32.inc Include Kernel32.inc Include /MASMPlus/Macros/Strings.Mac IncludeLib User32.lib IncludeLib Kernel32.lib .Data szTxt db '你号abcdefghig测试klmnop啊qrst1234567里890',0 szFmt db '%C',0 szCap db 'Unicode单字符格式化',0 .Data? usText db 128 dup (?) szBuff db 128 dup (?) .Code Ascii2Unicode Proc _lpwszReturnBuf:DWORD,_lpszSourceBuf:DWORD pushad invoke lstrlen,_lpszSourceBuf inc eax invoke MultiByteToWideChar,CP_ACP,0,_lpszSourceBuf,-1,_lpwszReturnBuf,eax popad ret Ascii2Unicode EndP Start Proc invoke Ascii2Unicode,addr usText,addr szTxt lea esi,usText .While WORD ptr [esi] invoke wsprintf,addr szBuff,addr szFmt,DWORD ptr [esi] invoke MessageBox,NULL,addr szBuff,addr szCap,0 add esi,2 .EndW ret Start EndP End Start