写了个小程序, 有些错误
程序代码:
.386 .model flat, stdcall option casemap:none ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> include windows.inc include kernel32.inc includelib kernel32.lib include user32.inc includelib user32.lib ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> .data? szBuffer db 1024 dup(?) dwId dw ? .data szTitle db 'Caption', 0 szFormat db '"%d"', 0 ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> .code _EnumWndProc proto hWnd:DWORD, lParam:DWORD START: invoke EnumWindows, offset _EnumWndProc, NULL invoke ExitProcess, 0 ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> _EnumWndProc proc hWnd, lParam ;invoke GetWindowText, hWnd, offset szBuffer, sizeof szBuffer ;invoke lstrlen, offset szBuffer invoke GetWindowThreadProcessId, hWnd, offset dwId invoke wsprintf, offset szBuffer, offset szFormat, dwId invoke MessageBox, NULL, offset szBuffer, offset szTitle, MB_OK ret _EnumWndProc endp end START