Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Killing Word processes
Message
De
10/07/2000 05:56:52
Paul Robinshaw
Silkworm Technologies Limited
Macclesfield, Royaume Uni
 
 
À
07/07/2000 06:26:58
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00389350
Message ID:
00390114
Vues:
14
Hi Macer,

>Paul,
>
>You can use the following func to get a list of processes running on a machine:
>
>FUNCTION GetProcessList
>*-- Returns a cursor of running process
>*-- Valid only for Win9x machines
>
>LOCAL lnHandle, lsProcessEntry, lcCursName, lnOldArea
>
>DECLARE INTEGER CreateToolhelp32Snapshot IN Win32Api INTEGER, INTEGER
>DECLARE INTEGER Process32First IN Win32Api INTEGER, STRING @
>DECLARE INTEGER Process32Next IN Win32Api INTEGER, STRING @
>DECLARE INTEGER CloseHandle IN Win32Api INTEGER
>
>lsProcessEntry = SPACE( ( 9 * 4) + 260)
>
>lcCursName = SYS(2015)
>lnOldArea = SELECT(0)
>SELECT 0
>
>CREATE CURSOR (lcCursName) (Process C( 254))
>
>lnHandle = CreateToolhelp32Snapshot( 2, 0)
>IF lnHandle > 0
>lnProcess = Process32First( lnHandle, @lsProcessEntry)
>DO WHILE lnProcess > 0
>INSERT INTO (lcCursName) VALUES (STRTRAN((SUBSTR(lsProcessEntry, (9*4 + 1), 260)), CHR(0)))
>lnProcess = Process32Next( lnHandle, @lsProcessEntry)
>ENDDO
>CloseHandle( lnHandle)
>ELSE
>*-- Error???
>ENDIF
>
>SELECT (lnOldArea)
>
>RETURN lcCursName


I haven't taken this for a spin yet. I notice the comment at the top "*-- Valid only for Win9x machines" Any ideas if this works under NT? Getting a list is great but how do I actually kill the thing?

Regards

Paul
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform