I'm here with what might seem like a very basic question, but I cannot figure it out.
I am using EnumChildWindows winapi to identify a particular child window of google chrome browser.
I fail when trying to return the handle of that child window when found.
BOOL CALLBACK enum_wnd_proc(HWND h, LPARAM lp)
{
wchar_t cls[1024] = {0};
GetClassName(h, cls, 1024);
if(std::wstring(cls) == L"Chrome_RenderWidgetHostHWND")
{
return false; // found, so end enumeration
}
return true;
}
Apart from using a global variable, I cannot figure a clean way to actually return the actual handle to the child window.
I'd appreciate any tips if someone has the time.