}
if (FindWindow("Valve001", NULL) == NULL) //is game closed?
break;
Sleep(20);
}
do
{
this->setHwnd(FindWindow("Valve001", NULL));
Sleep(20);
} while (this->hwnd == NULL);
static DWORD dll = 0;
HANDLE s = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, this->pid);
if (s == NULL || GetLastError() != 0)
return false;
MODULEENTRY32 m = { 0 };
m.dwSize = sizeof(MODULEENTRY32);
BOOL have = Module32First(s, &m);
while (have)
{
if (strcmp(m.szModule, "client.dll") == 0)
{
dll = (DWORD)m.modBaseAddr;
break;
}
have = Module32Next(s, &m);
}
CloseHandle(s);
if (!dll)
return false;
FindWindow(LPCWSTR("Valve001"), NULL)
if (wcscmp(m.szModule, LPCWSTR("client.dll")) == 0)
#undef UNICODE
MyFunction( L"MyString" );