Prevent background windows from showing in combo-box
Common windows applications that have no presented window and run in the background show within display locks combo box.
Examples: Microsoft Store and Calculator.

Hi, if this issue is still active I'd like to help. It seems its not an entirely trivial fix though as the required information is not easily queryable.
Hello!
I think the way to check would be to check each windows window style.
You can use spy++/spy64++ to check each windows style.
I have a feeling either styles or the window class could be used to filter this stuff out.


Let me know if you need some guidance.
I gotta get few hours of sleep, I'll have another look tomorrow. I managed to filter out most of the hidden uwp windows by using the windowinfo border properties, I did have a look at the styles and it might still be an option. The remaining windows are the ones spawned by the ApplicationFrameHost in which some are legitimate and others aren't, so maybe the window style can filter out the remaining.
Sounds good to me.
Okay so from what I can see messing with the styles, classnames and everything sadly there is not an easy way to distinguish which UWP apps are the hidden ones and which aren't. It would of course be possible to filter out all UWP apps by classname since they all share the "ApplicationFrameWindow" classname. I'm aware this isn't the ideal solution but I'm not sure how else to go about it. The styles are identical for the hidden store/edge windows and a settings window I opened myself and so is every other property in Spy++ / win32 api queries I tried.
were you able to filter out a good portion of them? Could you post what you've done?
// checks if window has borders (hides some unwanted hidden UWP windows from the drop-down)
BOOL checkBorders(HWND hwnd) {
WINDOWINFO wInfo;
ZeroMemory(&wInfo, sizeof(WINDOWINFO));
if (GetWindowInfo(hwnd, &wInfo)) {
if (wInfo.cxWindowBorders == 0 && wInfo.cyWindowBorders == 0) {
return FALSE;
}
}
return TRUE;
}
// checks if process is the Application Frame Host, in which case, hide it.
BOOL checkAppFrameWindow(HWND hwnd) {
char className[500];
GetClassNameA(hwnd, className, 500);
if (!strcmp(className, "ApplicationFrameWindow")) {
return FALSE;
}
return TRUE;
}
I added these checks, it seems that most of the hidden instances have border size of 0 pixels so they can be filtered out. I am a bit unsure whether any normal app can have this property, but it didn't seem like it during some (very) quick testing. The second check removes all the windows spawned by the ApplicationFrameHost process essentially, which sadly also will hide UWP windows opened by the user. If this check isn't enabled you will still get a few false positives.
I found another solution here:
https://stackoverflow.com/questions/39609643/determine-if-c-application-is-running-as-a-uwp-app-in-desktop-bridge-project
But I would like to avoid opening processes due potential conflicts with anti-cheats.
But maybe with what you have there is a way we can figure out how to filter it still. Unfortunately I will be out all day today, so I will be willing to take another look on Monday.
Thank you for your work!
Yea, opening handles might be a bit intrusive especially if used for games.
We could of course resort to only opening process handles if the application is a UWP app (find by class name). Even then, Im not sure this helps much since the package name might not differ whether its a background app or not?
Anyway, if you want me to open a PR for the above I can do that, also without the last check it will still filter out most of the false positives it seems.
Yea add it, but comment out the last check.
make sure you're on develop branch and brackets on new lines.
Thanks!
I believe I have found a way of filtering out the last ones, it seems that UWP apps create a child window with classname "Windows.UI.Core.CoreWindow" if you open an nstance of the UWP app. I added an extra callback to enumerate child windows for UWP classes, I have added this to the function and will make a PR. It looks to work perfectly on my end.
That's great! Unfortunately I'm going to be out, so I cannot test this, but I will check when I get back.
Closing issue as fixed in #81
reverted in #95 as fullscreen games were not appearing (still checks for classname, but borderless still appear)