Skip to content

Commit

Permalink
fixed checking for UWP
Browse files Browse the repository at this point in the history
  • Loading branch information
Stateford committed Jan 8, 2019
1 parent eb44537 commit e276108
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions dispLib/src/win.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,12 @@ BOOL checkUWP(HWND hwnd)
ZeroMemory(&wInfo, sizeof(WINDOWINFO));
if (GetWindowInfo(hwnd, &wInfo))
{
if (!strcmp(className, "ApplicationFrameWindow"))
if (strcmp(className, "Windows.UI.Core.CoreWindow") == 0 || strcmp(className, "ApplicationFrameWindow") == 0)
{
// If the EnumChildWindows returns false, that means a core window has been found, therefore do not hide (return true).
return !(EnumChildWindows(hwnd, &EnumChildProcUWP, (LPARAM)NULL));
return FALSE;
}
}
return TRUE;
}

// Enumerates child windows of UWP application and checks if there is an actual window open.
BOOL CALLBACK EnumChildProcUWP(HWND hwnd, LPARAM lParam)
{
char className[500];
GetClassNameA(hwnd, className, 500);

// Checks if the child window is a CoreWindow (this seems to signify whether there is a window open)
return strcmp(className, "Windows.UI.Core.CoreWindow");
return TRUE;
}

// enumerate windows and get current window list
Expand Down

0 comments on commit e276108

Please sign in to comment.