View Full Version : Enum_Processes
DaveR
30-Mar-2023, 09:55 AM
Just noticed this very useful little program doesn't run properly under 20.1 as it is firmly 32 bit.
Before I apply my rather thin 64 bit skills in bringing it up to date has anyone already done so?
Marco
30-Mar-2023, 04:50 PM
Unaware of that program, but would a powershell script be the best way now-days?
DaveR
30-Mar-2023, 10:15 PM
Unaware of that program, but would a powershell script be the best way now-days?
probably. It happens that the program is also where I built my run-once code so I'm attached to it.
Focus
31-Mar-2023, 12:51 AM
I may have I will look later
Vincent Oorsprong
31-Mar-2023, 08:19 AM
Dave,
cDRReport contains code to enumerate the process modules to get the version number of the DataFlex Reports OCX in the function OCXVersion.
Is that useful for you?
Focus
31-Mar-2023, 09:16 AM
EnumProcesses is just Id's
As Vincent says he has done the EnumProcessModules which is module names and calls the wide version of GetModuleFileNameW
#IFNDEF Get_dfxEnumProcesses
External_Function WinAPI_EnumProcesses "EnumProcesses" Psapi.dll Pointer pProcessIds DWord cb Pointer pBytesReturned Returns Integer
Function dfxEnumProcesses Global Returns DWord[]
Integer iSize iElements cb
Boolean bOk bStop
DWord[] dwaProcessIds
// don't know how big to make our array. So keep doubling until it's big enough.
Move 1024 to iSize
Move iSize to Cb
Repeat
Move (iSize/SizeOfType(DWord)) to iElements
Move (ResizeArray(dwaProcessIds,iElements)) to dwaProcessIds
Move (WinAPI_EnumProcesses(AddressOf(dwaProcessIds),iSi ze,AddressOf(iSize))) to bOk
Case Begin
Case (iSize=0)
Case (iSize=cb)
Move (cb*2) to cb
Move cb to iSize
Case Break
Case Else
Move True to bStop
Case End
Until bStop
// now do the real call
Move (iSize/SizeOfType(DWord)) to iElements
Move (ResizeArray(dwaProcessIds,iElements)) to dwaProcessIds
Move (WinAPI_EnumProcesses(AddressOf(dwaProcessIds),iSi ze,AddressOf(iSize))) to bOk
Function_Return dwaProcessIds
End_Function
#ENDIF
DaveR
31-Mar-2023, 10:30 PM
Dave,
cDRReport contains code to enumerate the process modules to get the version number of the DataFlex Reports OCX in the function OCXVersion.
Is that useful for you?
Yes, thanks. tied up doing boss stuff and left this alone, but the code that Focus extracted will do the job nicely.
DaveR
31-Mar-2023, 10:31 PM
that's it, and helped me find my original. Thanks
Powered by vBulletin® Version 4.2.5 Copyright © 2023 vBulletin Solutions Inc. All rights reserved.