Question about Service.StartForeground

flyingbag

Member
Licensed User
Longtime User
Hello,

I want to start a service in the foreground.

In the service module - my code is
'Service module
Sub Process_Globals

Dim sNotif As Notification

end SUb

Sub Service_Create
sNotif.Initialize
sNotif.Icon = "icon"

sNotif.SetInfo("MyApp","Service Running",Main)
sNotif.Sound = False
sNotif.Notify(1)
Service.StartForeground(1,sNotif)
end Sub

The service runs fine as expected - however i do *NOT* want any icon or notification in the status bar.
Is it possible to use Service.StartForeground without displaying status bar notification?

If i comment the "sNotif.SetInfo" the app crashes...
 

schimanski

Well-Known Member
Licensed User
Longtime User
I have set

sNotif.Icon = null,

so there is no notify shown. But the question is, is the service now in the foreground?
 
Upvote 0
Top