Search code examples
windowsservicetaskbar

Windows service cannot see Shell_TrayWnd


I need to hide the taskbar and start button via a Windows service.

In a console program I can successfully call FindWindow and/or EnumWindows to get the "Shell_TrayWnd" window and then hide it using ShowWindow(hwnd, SW_HIDE).

But when the service performs FindWindow("Shell_TrayWnd", NULL) it returns NULL, and when the service performs EnumWindows it gets an incomplete list which does not include the "Shell_TrayWnd" window.

Can anyone suggest how a service can see the "Shell_TrayWnd" window, or suggest an alternative method for hiding the taskbar and start button (that works in a service)? Thanks.


Solution

  • Unfortunately, there is no way for a service to access windows. It's a (designed) limitation for services.