My program's call to EnumWindows() returns FALSE and GetLastError() occasionally returns ERROR_ALREADY_EXISTS (#183, "Cannot create a file when that file already exists"). What does that error mean in that context?
Here is a code snippet:
static BOOL CALLBACK CollectTopLevelWindowsEnum(HWND hWnd, LPARAM lParam)
{
// This one is good
s_windows.push_back(hWnd);
return TRUE;
}
...
if (!EnumWindows(CollectTopLevelWindowsEnum, NULL)) {
DWORD lastError = GetLastError();
if (lastError != ERROR_SUCCESS) {
TRACE("EnumWindows failed: %d.\n", lastError);
}
}