Posted on 1998-12-16
I have an NT Service I wrote in VB5. As you know a NT Service can not have a GUI so without putting my application to sleep, which nothing can access it, or running a loop that takes up 100% of the CPU all the time, how can I get it to idle?
I have to, because it's a service, create a new thread to run my own stuff. Creating this thread, but then it's destroyed as soon as the function starts up. I could of used that hProcess from CreateThread function, but I have to destroy it so that the NT Service portion of it will run.
Would this be what I use:
Declare Function WaitForInputIdle Lib "user32" _
Alias "WaitForInputIdle" (ByVal hProcess As Long, _
ByVal dwMilliseconds As Long) As Long
If so how do I get the hProcess of my application?