怎么判断进程名称和指定名称想同?
我刚学习汇编,现有一个问题不明白,请大侠指导一下。谢谢!
有以下一段代码:
.data?
hWinList dd ?
.const
szDestName db 'abc.exe',0
.code
_GetProcessInfo proc _hWnd
local @stProcess:PROCESSENTRY32
local @hSnapShot
invoke RtlZeroMemory,addr @stProcess,sizeof @stProcess
invoke SendMessage,hWinList,LB_RESETCONTENT,0,0
mov @stProcess.dwSize,sizeof @stProcess
invoke CreateToolhelp32Snapshot,TH32CS_SNAPPROCESS,0
mov @hSnapShot,eax
invoke Process32First,@hSnapShot,addr @stProcess
.while eax
mov ecx,offset szDestName ;这里
mov esi,@stProcess.szExeFile ;这里
cmp ecx,esi ;这里
.if eax
invoke SendMessage,hWinList,LB_ADDSTRING,0,addr @stProcess.szExeFile
add szWinNum,1
invoke SendMessage,hWinList,LB_SETITEMDATA,eax,@stProcess.th32ProcessID
.endif
invoke Process32Next,@hSnapShot,addr @stProcess
.endw
invoke CloseHandle,@hSnapShot
ret
_GetProcessInfo endp
上面3个地方要怎么写才对呢?我这样写了了通不过编译。我的目的是要当进程名等于abc.exe时,就把它加入ListBox.请大家指导下!
注,hWinList已经被指向一个ListBox