Windows Services ( Including Nettalk websites ) and using SYSTEM{PROP:HIDE}=TRUE

I started using windows services many years ago to automate many of the tasks that I do and that my clients need. I would get system hangs on many of the services on a monthly basis. Just over 2 years ago I implemented a line of code in any program that didnt need a window. This not only included windows services but command line utilities that hid progress windows. Prior to applying this new line of code I had applied the “delete all controls” template. This improved things but it was not a perfect fix. The template only worked on template windows and even then there were still some hangups from time to time. Some of these hangups were more often than others. I was never able to pinpoint exactly how or where these problems came from. I have had these issues on several different versions of windows both server and desktop and different versions of clarion and selfservice. Since some lockups happened on command line items i dont think selfservice is the issue. I had read through the article here about SYSTEM{PROP:HIDE} and was playing around with it to see how it worked. ( I had similar gain focus problems i was trying to resolve ). What I noticed is that some controls appear not to be created as seen in the screen shot provided by Carl Barns. Anything that takes input is not created. I confirmed this and played around with this setting for a while. I then looked further and saw that this was intended to run a program on one computer while another computer has the user interface. That made me think. All of my programs that dont need a window should work with this setting on. I tried that and everything worked as expected. I really was desperate for a solution so I put this into production systems. Everything worked and that was the first step. I waited and that one service stayed up without any problems for months. I then added this switch to more and more services. With each service i had less hangups. I then added this to my netalk websites and finally I added it to my reporting engine that is called from a command line. That being my oldest program and was at one time automated using the windows built in timer. That program also would hang from time to time. I could use the windows timer to kill and restart if needed. It has been 2 years using this setting in anything that runs in the background. As a note. I never removed the destroy all controls templates from all my services. I am putting this out there for review. Its one line of code. If this works or does not work than please discuss this here.

4 Likes

Thanks for the information

Thanks for share @JeffH .

To understand correctly, you set SYSTEM{PROP:HIDE} at the beginning of the procedure?

Before the first window opens in your program. This is a onetime switch. Once turned on it should stay on.

If RunningAsAService = 1
SYSTEM{PROP:HIDE} = TRUE
End
SELF.OpenWindow(FirstWindow)

I have it in all of my EXE’s

1 Like

Many Thanks @JeffH ! Will try it as well

For when you need console only apps, here’s a thread Using WriteConsoleA from a Clarion application

Thank you for this information. It really helps. Specially for the NetTalk.