Exempelkoden är inte särskilt snygg, snabbt hack, men den fungerar:
BOOL
GetStatusbarTextMemory (HWND a_hwndStatusbar, int a_index, LPWSTR szBuffer, HANDLE hProc)
{
LPVOID r;
BOOL rt = TRUE;
r = VirtualAllocEx(hProc, NULL, 2048, MEM_COMMIT, PAGE_READWRITE);
if(r!=0)
{
if(SendMessage(a_hwndStatusbar, SB_GETTEXT, (WPARAM)a_index, (LPARAM)r))
{
if(!ReadProcessMemory(hProc, (LPCVOID)r, (LPVOID)szBuffer, 256, NULL))
{
rt = FALSE;
}
}
else
{
rt=FALSE;
}
VirtualFreeEx(hProc, r, 0, MEM_RELEASE);
}
else
{
rt = FALSE;
}
return rt;
}