--- In [email protected], "brucexs" <bswit...@...> wrote:
> *info expr(yourplug.yourserv(arg))
Well, I wrote a plugin and assigned the above to a button. But when I start
PowerPro I get a never-ending succession of message boxes with title "PowerPro"
saying "Invalid launch menu HookWindowEvents".
I used "*info expr(pppmem.pppmem())" and my DLL exports pppmem().
typedef BOOL (*GMSExTYPE)(LPMEMORYSTATUSEX);
GMSExTYPE GMSEx;
HMODULE hKernel32;
BOOL WINAPI MyDllMain(VOID) {
GMSEx = NULL;
hKernel32 = GetModuleHandle("KERNEL32.DLL");
GMSEx = (GMSExTYPE) GetProcAddress(hKernel32, "GlobalMemoryStatusEx");
return TRUE;
}
_declspec(dllexport) VOID pppmem( LPSTR szv, LPSTR szx, BOOL (*GetVar)(LPSTR,
LPSTR),
VOID (*SetVar)(LPSTR, LPSTR), DWORD* pFlags, UINT nargs, LPSTR* szargs,
PPROSERVICES* ppsv )
{
DWORD dwResult;
if ( GMSEx )
{
MEMORYSTATUSEX msex;
msex.dwLength = sizeof(MEMORYSTATUSEX);
GlobalMemoryStatusEx(&msex);
dwResult = msex.ullAvailPhys >> 20;
}
else
{
MEMORYSTATUS ms;
ms.dwLength = sizeof(MEMORYSTATUS);
GlobalMemoryStatus(&ms);
dwResult = ms.dwAvailPhys >> 20;
}
wsprintf(*szargs, "%lu", dwResult);
ppsv->ReturnString(*szargs, szargs);
}