I run into a little problem. I registered my program as a Service and after a reboot it starts but it shows not his TrayIcon. I think it starts too early before the User is logged in (starts as SYSTEM).
How could i fix this? I first thought I check if the User is logged in or delay the start, but maybe i run into the wrong direction to fix this and there is a more correct one? How does other Services starts after User login?
Service starts too early
Re: Service starts too early
afaik,
services cannot have gui elements. cannot create windows, also not a systray icon.
But they can run without a user logged in, without a "gui" running .
You have to interact with an extra exe (which do the gui stuff)
with the service via sockets or shared memory(or something other i forgot) .
The extra exe can only run if the/a user is logged in and you have to put it
in the autostart folder or start via taskplanner
services cannot have gui elements. cannot create windows, also not a systray icon.
But they can run without a user logged in, without a "gui" running .
You have to interact with an extra exe (which do the gui stuff)
with the service via sockets or shared memory(or something other i forgot) .
The extra exe can only run if the/a user is logged in and you have to put it
in the autostart folder or start via taskplanner
SPAMINATOR NR.1
Re: Service starts too early
Sorry, I described it wrong: i already start a extra program over that own Service program, but this Service program start the main program too early on boot up and that Service is only there for Autostart this program on boot, because it need Admin rights.
The rest is not true at all, see JHPJHPs example script of his Service Library. The Service didn't need a data exchange with the program it runs at all. And also it don't need to be in Taskscheduler or Autostart at all, other programs use that also without that to start themselves on boot.
But like i said, the Service starts my GUI program too early.
Edit: did not need it anymore, i used schtasks with runprogram() to make a Autostart without to use a Service for it.
The rest is not true at all, see JHPJHPs example script of his Service Library. The Service didn't need a data exchange with the program it runs at all. And also it don't need to be in Taskscheduler or Autostart at all, other programs use that also without that to start themselves on boot.
But like i said, the Service starts my GUI program too early.
Edit: did not need it anymore, i used schtasks with runprogram() to make a Autostart without to use a Service for it.
Re: Service starts too early
Services can't interact with the active user session (it always runs in session 0) since Vista, not without hacks.
Re: Service starts too early
that is the way.Balmung wrote:Edit: did not need it anymore, i used schtasks with runprogram() to make a Autostart without to use a Service for it.
SPAMINATOR NR.1