In een applicatie moet ik een andere app starten, en monitoren (wachten totdat 'ie afgesloten is). Dit doe ik door een timertje elke seconde te laten kijken of die app nog draait. Het vreemde is, dat wanneer het programma dat ik monitor actief is, deze verdwijnt uit de "running processes" lijst!
Getest met meerdere apps. Zodra je een appl. actief maakt, verdwijnt deze uit de list1! Is dit een bug of normaal gedrag?
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
| Dim ThisAppHandle As Long
Dim NextAppHandle As Long
Dim AppClassName As String
List1.Clear
'Get your current application owner's
'handle
ThisAppHandle = getwindow(frmLogin.hWnd, GW_OWNER)
'Pass it on as a seed for the next handle
'so all the windows in the z order can be
'searched
NextAppHandle = ThisAppHandle
'Perform the iterations in the Z order till
'all the running applications (either foreground
'or background) have been run through
Do While NextAppHandle <> 0
DoEvents
'Get the handle of the next window
'in the Z order
NextAppHandle = getwindow(NextAppHandle, GW_HWNDNEXT)
'Retrieve its window's classname
List1.AddItem GetAppClassName(NextAppHandle)
Loop |
Getest met meerdere apps. Zodra je een appl. actief maakt, verdwijnt deze uit de list1! Is dit een bug of normaal gedrag?