Hi all,
How i can receive list of active processes. When i want to receive list of all active
processes i use API CreateToolhelp32Snapshot but i want to receive the list of visible
processes only. (When i press CTRL+ALT+DEL, i see that list).
Thanks in advance
How i can receive list of active processes. When i want to receive list of all active
processes i use API CreateToolhelp32Snapshot but i want to receive the list of visible
processes only. (When i press CTRL+ALT+DEL, i see that list).
Thanks in advance
hi, look here
just convert this Little vb snipped in the middle of that thread to asm.
or just have a look at the "EnumWindows" API in your references.
just convert this Little vb snipped in the middle of that thread to asm.
or just have a look at the "EnumWindows" API in your references.
or you could always do a loop with the getwindow api.
have a look here
there?s an nice example for win9x and nt4
there?s an nice example for win9x and nt4
doesn't GetWindow need a source window?
here some of my vb code to look at:
if u want i can also attach and app using this code everything looks ok to me so far.. the only problem would be with the process identifiers if u needed them.
--------------------------------------------------------------------------------------
Sub AllOpenWindows(lst As ListBox)
'-HeXeN
Dim FirstWindow As Long
Dim NextWindow As Long
Dim LastWindow As Long
Dim CN As String
lst.Clear
FirstWindow& = GetActiveWindow
NextWindow& = FirstWindow&
Do: DoEvents
If IsWindowVisible(NextWindow&) <> 0 Then
If GetParent(NextWindow&) = 0 Then
CN$ = String(255, vbNullChar)
Call GetWindowText(NextWindow&, CN$, 255)
lst.AddItem CN$
End If
End If
NextWindow& = GetWindow(NextWindow&, GW_HWNDNEXT)
Loop While NextWindow& <> 0
End Sub
------------------------------
sorry to everyone who hates vb code :)
---------------------------------------------
if u want i can also attach and app using this code everything looks ok to me so far.. the only problem would be with the process identifiers if u needed them.
--------------------------------------------------------------------------------------
Sub AllOpenWindows(lst As ListBox)
'-HeXeN
Dim FirstWindow As Long
Dim NextWindow As Long
Dim LastWindow As Long
Dim CN As String
lst.Clear
FirstWindow& = GetActiveWindow
NextWindow& = FirstWindow&
Do: DoEvents
If IsWindowVisible(NextWindow&) <> 0 Then
If GetParent(NextWindow&) = 0 Then
CN$ = String(255, vbNullChar)
Call GetWindowText(NextWindow&, CN$, 255)
lst.AddItem CN$
End If
End If
NextWindow& = GetWindow(NextWindow&, GW_HWNDNEXT)
Loop While NextWindow& <> 0
End Sub
------------------------------
sorry to everyone who hates vb code :)
---------------------------------------------
mh i don't know, looks like it could work, but i think it's a little kinky
to do it like this. EnumWindows is made for this purpose...
to do it like this. EnumWindows is made for this purpose...
Thank you very much - EnumWindows is a good solution !