Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Closing an other '.exe'
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00761170
Message ID:
00761522
Vues:
28
Here is what I have. It all seems to work until I call "EnumProcessModules"


DECLARE INTEGER GetWindow IN Win32API;
INTEGER HWND, INTEGER dflag

DECLARE INTEGER GetWindowThreadProcessId IN Win32API ;
INTEGER HWND, INTEGER @lpdwProcId

DECLARE INTEGER EnumProcessModules IN psapi;
INTEGER hProcess, STRING @ lphModule,;
INTEGER cb, INTEGER @ cbNeeded

LOCAL lnProcessHndle, lnHandle, lnBufSize, lcModBuf, lnModBufRet
STORE 0 TO lnProcessHndle, lnHandle

* From your code!
lnBufSize = 4096 && should be large enough
lcModBuf = Repli(Chr(0), lnBufSize)
lnModBufRet = 0

* Get the handle to the next window
lnHandle = GetWindow(lnhwnd, 2)
* This is to get the process handle.
lnHandle = GetWindowThreadProcessId(lnHandle, @lnProcessHndle)

* At this point the value of "lnProcessHndle" is the value I see when I open the Task Manager.
* So I know I found the right Process Handle. Why then does the following fail?

* This always returns 0 WHY???
lnHandle = EnumProcessModules(lnProcessHndle, @lcModBuf, lnBufSize, @lnModBufRet)

Thanks for your patience
Mike
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform