CONTEXT ct;
HANDLE hl = OpenThread(THREAD_ALL_ACCESS, FALSE, dwWindowThreadID);
if(hl == NULL)
{
ShowLastErrorMessage(hCurrentWindow);
}
else
{
if(SuspendThread(hl) < 0)
{
ShowLastErrorMessage(hCurrentWindow);
}
else
{
if(!GetThreadContext(hl, &ct)) ShowLastErrorMessage(hCurrentWindow);
if(ct.Esp != 0) MessageBoxA(hCurrentWindow, "ESP VALID.", "OK", 0);
ResumeThread(hl);
}
}