Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to knowe user PC Activity
Message
De
08/07/2002 08:42:35
 
 
À
08/07/2002 08:27:19
Mazahir Naya
Kuwait United Co.
Kuwait, Kuwait
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00675941
Message ID:
00676073
Vues:
15
>hi Macer
>thanks for reply
>i want to knowe which application currently runing on client pc.
>and give more information about process32 .
>thanks again

George Tasker has a good download Is_Run, which allows you to ask what application is running. See in the downloads section.

If you need a list of processes running on the machine, you can use the Process32 api. See below:

Mace

FUNCTION GetProcessList
*-- Returns a cursor of running process

LOCAL lnHandle, lsProcessEntry, lcCursName, lnOldArea
LOCAL lcProcessName

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
lcProcessName = (STRTRAN((SUBSTR(lsProcessEntry, (9*4 + 1), 254)), CHR(0)))
INSERT INTO (lcCursName) VALUES (lcProcessName)
lsProcessEntry = SPACE( ( 9 * 4) + 260)
lnProcess = Process32Next( lnHandle, @lsProcessEntry)
ENDDO
CloseHandle( lnHandle)
ELSE
*-- Error???
ENDIF

SELECT (lnOldArea)

RETURN lcCursName
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform