![]() |
![]() |
|
![]() |
![]() |
|
Programmierung Rat & Tat für Programmierer |
![]() |
|
Themen-Optionen | Ansicht |
![]() |
#1 |
Master
![]() |
![]() Ich möchte in Visual Basic einen Taskmanager schreiben und hab bis jetzt keinen API-Call gefunden mit dem ich alle Laufenden Prozesse auslesen kann.
Das einzige was ich gefunden habe ist FindWindowA in User32. Da muss man aber einen Classname oder Windowname angeben. Ich bräuchte aber eine möglichkeit mit der ich alle laufenden Prozesse auslesen kann. Weiss wer Rat!? ------------------ __________________ |»»»»»SONIC««««««| ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ |
![]() |
![]() |
![]() |
#2 |
Master
![]() |
![]() Kennt sich denn wirklich keiner mit der Windows API aus!?
![]() ------------------ __________________ |»»»»»SONIC««««««| ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ |
![]() |
![]() |
![]() |
#3 |
Master
![]() |
![]() Also nach langem herumsuchen hab ich endlich ein Codesample gefunden! *freu*
Falls es wen interessiert hab ich den Code reinkopiert. Er dürfte allerdings für win 3.11 geschrieben worden sein. Also muss man die Api Function Declares umstellen. Hab mir einfach die gleichnamigen aus Dem API-Text-Viewer rausgeholt. Man muss eine Form mitübergeben und auf der Form sollten sich 2 Listboxen befinden. (list1, list2) diese werden dann mit den Fensternamen und classennamen befüllt. Also falls wer braucht: Sub classnames (frm As Form) 'This gets a list of all current window titles and classnames 'Useful if you use SENDKEYS or classnames with API's. 'You need two list boxes, LIST1 (takes classnames) and LIST2 (takes window titles) 'this sub is adapted from the Waite Group's How To VB book (great ideas !) ' Get the hWnd of the first item in the master list ' so we can process the task list entries (top-level only). Dim currwnd, length, listitem$, aa$, q%, X currwnd = GetWindow(frm.hWnd, GW_HWNDFIRST) ' Loop while the hWnd returned by GetWindow is valid. While currwnd <> 0 ' Get the length of the task name identified by ' CurrWnd in the list. length = GetWindowTextLength(currwnd) ' Get the task name of the task in the master list. listitem$ = Space$(length + 1) length = GetWindowText(currwnd, listitem$, length + 1) ' If there is an actual task name in the list, add the ' item to the list. If length > 0 Then frm.List1.AddItem listitem$ aa$ = Space$(20) q% = GetClassName(currwnd, aa$, 20) If q% Then myutils.List2.AddItem aa$ End If 'Get the next task list item in the master list. currwnd = GetWindow(currwnd, GW_HWNDNEXT) ' Process Windows events. X = DoEvents() Wend End Sub |
![]() |
![]() |
![]() |
Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1) | |
|
|