hello, everybody.
i'm learning a code which written by comrade <comrade2k@hotmail.com>.
in system, we know one time a process created, another time a process exited.
so the processes in system are changing every moment.
when the code is running, she could found all processes that created before the code have run.
if push the Refresh button, she only found the system processes, did't knew user the processes and the processes created after the code have run.
as the code initialized rightly. i modified a little lines. set a "qFlag" which distinguished "close" and "Refresh" . when pushed the Refresh button, close dlgproc, restart the code again.
although it can working, but it isn's a good method which figured out the list all processes at pushing the Refresh button.



my question:
1. whether a method that don't closed dlgproc, restarted again, it can list all processes in the system every moment.
2. how check the changing processes at every times.


best regards.




start:
invoke GetModuleHandle, NULL
mov hInst, eax
invoke DialogBoxParam, hInst, 1000, 0, ADDR WndProc, NULL
invoke ExitProcess, NULL
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
WndProc proc hWnd:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD
.if uMsg==WM_INITDIALOG
invoke LoadIcon,hInst,1
mov hIcon, eax
invoke SendMessage, hWnd, WM_SETICON, IMAGE_ICON, eax
invoke GetDlgItem,hWnd,1001
mov hList, eax
invoke Refresh
.elseif uMsg==WM_COMMAND
mov eax, wParam
.if ax==1002 ; Refresh button
invoke Refresh
.elseif ax==1003



start:
invoke GetModuleHandle, NULL
mov hInst, eax
invoke DialogBoxParam, hInst, 1000, 0, ADDR WndProc, NULL
.if qFlag==FALSE
jmp start
.endif
invoke ExitProcess, NULL
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
WndProc proc hWnd:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD
.if uMsg==WM_INITDIALOG
mov qFlag,TRUE
invoke LoadIcon,hInst,1
mov hIcon, eax
invoke SendMessage, hWnd, WM_SETICON, IMAGE_ICON, eax
invoke GetDlgItem,hWnd,1001
mov hList, eax
invoke Refresh
.elseif uMsg==WM_COMMAND
mov eax, wParam
.if ax==1002 ; Refresh button
mov qFlag,FALSE
invoke Refresh
jmp qexit
.elseif ax==1003
Posted on 2004-11-21 01:52:01 by dcskm4200