I have simple no-UI application that will be then converted to windows service. but for testing it would be useful to see when it’s running. so I’d like to create a taskbar button as other applications with UI have. is it possible with reasonable effort?
I have simple no-UI application that will be then converted to windows service. but
Share
No, it’s not possible. Buttons on the taskbar represent windows. You can’t have a button without a window, and that window needs to be visible. (The window can have coordinates that place it off the screen(s), and it can have zero dimensions, but it needs to have the
WS_VISIBLEstyle.)Another option is to create a notification icon. It needs to have a window, too, but the window doesn’t have to be visible. Getting that set up might be more effort than you want, though, if the end goal is for the program to be a service; services can’t show notification icons or have windows.
Perhaps the easiest change is to simply make your program be a console program. Then the OS will create a console window for you. Your program doesn’t have to create it or manage it in any way.