Sign in to follow this  

How to get hwnd of a game client?

This topic is 1111 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites

This topic is 1111 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this