Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting user in another application on Win 95 Network
Message
From
06/11/1998 05:43:58
 
 
To
06/11/1998 00:12:06
Stephen E Johnson
Johnson & Associates Business Software
Corvallis, Oregon, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00155122
Message ID:
00155135
Views:
18
>I have a client that is networked using Win 95. I would like to be able to identify if a user has a specific application open that must be closed at midnight to avoid problems.

If it's a console application (something that has a user interface), and you know the exact text of the caption for the main window, you can check to see if the window exists with the API call FindWindow().

>
>The next step if the above is possible would be to terminate the application if possible.

Assuming that the first is true and it's a Windows application, you can use SendMessage() to try to shut it down. If somehow you could get the Process Handle, you could use TerminateProcess() to shut it down, but you'd need to record the ProcessID at startup and hang onto it until it was needed. The easiest way to do that would be to write a small application that launched the app you want to be able to shut down. It would then wait until the shutdown time, and if the process it launched was still running, kill it via SendMessage() or TermianteProcess() as appropriate, and then shut itself down.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform