kimiraikkonen said:
Guy,
I also wonder how to implement a progressbar to see an updated
position of a Windows Service using s"ervice controller" control.
Don't know which API function does show you the current service
proceeding situation within a progress bar, (also knowing it would be
good, not so criticial), reporting only "servicecontroller1.status" as
text.
Hi and thanks for the interest
What am I trying to do:
A screen with a listview , each listitem is a service, each listitem will
have at least three columns (current status e.g. sleeping or copying or
sending emails, description e.g. copying this table and finally a progressbar
showing the %)
A good example is the copy progress when you copy a table from one db to
another using sql server 2005 export/import table
I still did not write it ... as my boss wants me to do other important
tasks...
I wrote the service as follows:
part 1 = a vb dll that has all the necessary methods including ServiceStart
& ServiceStop.
This dll will also include three properties
a. Current Status
b. What am I doing
c. Job Percentage (0-100)
Whenever the dll will reach one of its task methods - the current status
will change to "Status x"
In this method the "what am i doing will change according to the current
point (e.g. copying this table"
If it will be in a loop the job percentage will also change.
Each time the loop ends the dll will raise an event "progress changed"
Part 2 = a vb service with the service start & stop methods.
In this part I declared the class in part1 and I intend to add three
properties
a. Current Status
b. What am I doing
c. Job Percentage (0-100)
The dll in part 1 will be declared withevents
Each time there is a progress update - the three properties will be updated.
Also here I should add some properties as the progressbar hwnd of the
service controller (and while it is zero - do not update it)
And include 2 custom service commands
1 to update the progress controls hwnd (probably make it read a file...)
2 to ask "what is your status?"
The Service controller (another program) :
will interact with the service (start/stop)
also will send two custom commands:
1: Get the progress controls hwnd from a file
2: Report "what is your status?"
As once Hannibal said: "i love when a plan comes together!"
Guy Cohen