Skip to content

Commit d439304

Browse files
committed
Some windows do not have menu items. Fixed.
1 parent 4c89df9 commit d439304

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

SmartSystemMenu/EnumWindows.cs

-5
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ public static IList<Window> EnumProcessWindows(int processId, IntPtr[] filterHan
4646

4747
private static bool EnumWindowCallback(IntPtr hwnd, int lParam)
4848
{
49-
if (!NativeMethods.IsWindowVisible(hwnd))
50-
{
51-
return true;
52-
}
53-
5449
if (_filterHandles.Any(h => h == hwnd))
5550
{
5651
return true;

SmartSystemMenu/Forms/MainForm.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ private void MenuItemExitClick(object sender, EventArgs e)
299299

300300
private void WindowCreated(object sender, WindowEventArgs e)
301301
{
302-
if (e.Handle != IntPtr.Zero && NativeMethods.IsWindowVisible(e.Handle) && !_windows.Any(w => w.Handle == e.Handle))
302+
if (e.Handle != IntPtr.Zero && new SystemMenu(e.Handle, _settings.MenuItems, _settings.LanguageSettings).Exists && !_windows.Any(w => w.Handle == e.Handle))
303303
{
304304
NativeMethods.GetWindowThreadProcessId(e.Handle, out int processId);
305305
IList<Window> windows = new List<Window>();

0 commit comments

Comments
 (0)