Use your ' thegetwindow(w, NEXT)' function inside your user process, not inside the service process (just comunicate with the service as needed). Why don't you spawn a user process at startup that does nothing and comunicate with the service as needed (all the job is done by this process, not the service itself) ?