Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A list of running applications
Message
De
30/05/1999 06:19:19
 
 
À
28/05/1999 08:46:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00223863
Message ID:
00224483
Vues:
13
>Thanks George - I nearly downloaded it before I posted the question, but didn't because I didn't think it would do what we were after.
>
>We only need to know if a dBase application is running or not, and this will do the trick without any mods.
>
>Thanks again

Ian,

You might also want to take a look at this

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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform