I need to get window hwnd and the title of the window is change evrey few
secondes.
how can I Use the FindWindow function with regular expression or any
different way to get the window hwnd
> how can I Use the FindWindow function with regular expression
You can't.
> or any different way to get the window hwnd
Use EnumWindows() to loop through all available windows, calling
GetWindowText() on each one and then comparing it as needed. When you find
a match, return it via the callback's lParam value. For example:
BOOL CALLBACK FindWindowWithExpr(HWND hwnd, LPARAM lParam)
{
TCHAR szText[256] = {0};
GetWindowText(hWnd, szText, 255);
if (szText matches your regular expression)
{
*((HWND*) lParam) = hWnd;
return FALSE;
}
reutrn TRUE;
}
{
HWND hWnd = NULL;
EnumWindows((WNDENUMPROC)&FindWindowWithExpr, (LPARAM)&hWnd);
if (hWnd != NULL)
...
}
--
Remy Lebeau (TeamB)\