Jump to content
  • Advertisement
Sign in to follow this  
strol

How to get hwnd of a game client?

This topic is 1399 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!