Advertisement

How to get hwnd of a game client?

Started by November 27, 2014 04:11 PM
0 comments, last by NightCreature83 10 years, 1 month ago

Hi, i try to get hwnd of text input in Warcraft 3 but i can't find anything exept one hwnd wich have window name Warcraft III. So how can i find other hwnd? I tried to find with WinSpy and with this code :


#include <windows.h>
#include <iostream>

BOOL CALLBACK EnumChildProc(HWND hWnd, LPARAM lp);

int main(int argc, char** argv)
{
HWND hWnd;
while( !( hWnd = FindWindow(NULL, "GameClient") ) )
{
Sleep(500);
std::cout << "Waiting for launch...\n";
}
EnumChildWindows(hWnd, &EnumChildProc, NULL);

return 0;
}

BOOL CALLBACK EnumChildProc(HWND hWnd, LPARAM lp)
{
char buff[128];
GetClassName(hWnd, buff, sizeof(buff));
std::cout << buff <<"\n";
return true;
}

By the way, i need to find that hwnd because i want to send key-pressing to chat. So may be there is another method.

Its extremely unlikely that Warcraft is using the win32 api to render the UI with. What this means is that you will not be able to find the HWND of an onscreen element.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

This topic is closed to new replies.

Advertisement