Here is, basically, how my application works:

When windows starts, my app starts. Whenever my app is running, it hides the desktop, taskbar, etc... When a button is clicked in my application ("Start program"), then my application will set its visible property at false and another application will start.

Everything seems to work perfect except I need a way for my application to set its visible property back to true, but only once the other application that was started earlier, is closed (no longer running.)

My thought was that I could use a timer to check for the applications state every so many seconds:

Dim pProcess() As Process = System.Diagnostics.Process.GetProcessesByName("vk")
        For Each p As Process In pProcess
            'do nothing, else set visibility to true
        Next

I have 2 concerns with this:
1. A timer checking this every few seconds will invoke unneeded stress on a computer since they are running for sometimes very long periods of time.
2. There is a better way to accomplish this that doesnt rely on a timer.

Please let me know if you have any ideas, I am stumped over here!

Thanks!

What do you mean by hide? Are you trying to hide the first window on the application when the second window appears without closing the application fully?

What do you mean by hide? Are you trying to hide the first window on the application when the second window appears without closing the application fully?

No, not really. Let me try again, I probably was not very clear before. So I have an application that runs all the time... its sole purpose is to lock things up (E.g.: not allowing use of taskbar, not allowing ctrl+alt+del, etc...)

This program has a button that, when pressed, runs a 3rd party application... indepedent of the program I made. Also, when this button is pressed, my application runs a simple me.visible=false type of script.

The problem lies when the user exits the 3rd party application. At this point, my application should become visible again (i.e.: me.visible=true).

I am not sure how to have my program check to see if the 3rd party application is still running, and if not, become visible. I assume my program would have to be checking the system processes constantly... but I really don't know how to go about accomplishing this.

Thanks for your interest!

This article has been dead for over six months. Start a new discussion instead.