ws_psapi_lib = 1
ws_psapi_h.l = OpenLibrary(ws_psapi_lib,"PSAPI.DLL")
*ws_EnumProcessModules = IsFunction(ws_psapi_h,"EnumProcessModules")
CloseLibrary(ws_psapi_lib)
Enter that code into your pb and run it.... I get a Windows runtime error. I am trying to use that .dll call (EnumProcessModules) as it is not one of the "built-in" calls in PB. I don't think that the PSAPI library is supported natively by PB yet, right?
best,
cal
Why does this not work and make an error?
-
- User
- Posts: 22
- Joined: Sun Feb 15, 2004 5:34 pm
-
- User
- Posts: 22
- Joined: Sun Feb 15, 2004 5:34 pm
thanks freak!
i am an idiot for missing that-
in the following code,
DWORD FindModule (HANDLE hProcess, const char* sModule)
{
HMODULE hMod[1024];
DWORD cbNeeded;
If( EnumProcessModules( hProcess, hMod, SizeOf(hMod), &cbNeeded) )
{
For ( unsigned int i=0 ; i < (cbNeeded / sizeof(HMODULE)) ; i++ )
{
char sModName[MAX_PATH];
GetModuleBaseNameA( hProcess, hMod, sModName, SizeOf(sModName) );
If ( !stricmp(sModName, sModule) )
{
Return (DWORD)hMod;
}
}
}
Return 0;
}
which is c++, what would I do to make the conversion to PB. for instance-
the HANDLE type, what do i use there? the HMODULE type? what to use there? swap DWORD with .l?
also, what would be a good way to convert the line:
HMODULE hMod[1024];
into pb? what does this do and what would be the code that would represent this in pb?
best,
mike
i am an idiot for missing that-
in the following code,
DWORD FindModule (HANDLE hProcess, const char* sModule)
{
HMODULE hMod[1024];
DWORD cbNeeded;
If( EnumProcessModules( hProcess, hMod, SizeOf(hMod), &cbNeeded) )
{
For ( unsigned int i=0 ; i < (cbNeeded / sizeof(HMODULE)) ; i++ )
{
char sModName[MAX_PATH];
GetModuleBaseNameA( hProcess, hMod, sModName, SizeOf(sModName) );
If ( !stricmp(sModName, sModule) )
{
Return (DWORD)hMod;
}
}
}
Return 0;
}
which is c++, what would I do to make the conversion to PB. for instance-
the HANDLE type, what do i use there? the HMODULE type? what to use there? swap DWORD with .l?
also, what would be a good way to convert the line:
HMODULE hMod[1024];
into pb? what does this do and what would be the code that would represent this in pb?
best,
mike