Working with different flavours of title.

This commit is contained in:
dp%netscape.com 2002-03-04 06:51:32 +00:00
parent 62884a5780
commit 476f48e7d5

View File

@ -52,8 +52,16 @@ BOOL IsMozilla(const char *title)
{
if (!title || !*title)
return FALSE;
// Skip to where the <space>-<space>Mozilla exists
return strstr(title, " - Mozilla") ? TRUE : FALSE;
// Title containing " - Mozilla" is a mozilla window
if (strstr(title, " - Mozilla"))
return TRUE;
// Title containing "Mozilla {" is a mozilla window
// This form happens when there is no title
if (strstr(title, "Mozilla {"))
return TRUE;
return FALSE;
}
BOOL IsNetscape(const char *title)
@ -77,8 +85,9 @@ BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
GetClassName(hwnd, buf, sizeof(buf)-1);
if (strcmp(buf, kMozAppClassName))
return TRUE;
GetWindowText(hwnd, buf, sizeof(buf)-1);
if (IsMozilla(buf)) {
// Yeah. Search ends.
*pwnd = hwnd;