Close program for other windows user

Close program for other windows user

Postby Jeff Barnes » Tue Jan 28, 2014 1:11 pm

My program will only allow one user to use it locally. I open a one DBF file locally in exclusive mode. This I do not wish to change.

Here is the scenario...

User A runs my program in their Windows Login.
Then User A walks away from their computer.
After xx time, the computer will go to the Windows Login screen (controlled by users IT department).
Now User B enters their Windows Login information and tries to run my program.
Since User A still has the program open, User B cannot run the program.

Is there any way to close the program running under a different user?
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Close program for other windows user

Postby driessen » Tue Jan 28, 2014 1:39 pm

Jeff,

I have build a solution for this problem. It's quite a big solution, to big to put the code in here but also to difficult because this code can be found in several parts of my code. But I'll try to describe what I do.

I have a file, containing all the controls of the different users.
Then I have a timer which checks some controls per user for instance every minute.
One control is to check if the program has to be closed on demand by another user.
The timer makes the program to read the control within one minute. If my control for closing the program is set to true by the other user, the program will read this, then put the control back to false and finally quit the program.

How does user A make the application quit on the PC of user B?

User A can select user B in a listbox. Then there is a button which put the control for quitting the program to true for the selected user (i.e. user B).
Within one minute, the PC of user B will quit the application.

I hope you understand what I mean.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Close program for other windows user

Postby Jeff Barnes » Tue Jan 28, 2014 2:08 pm

Driessen,

Thank you... this gives me an idea of how to solve it :D
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: Close program for other windows user

Postby dutch » Thu Feb 06, 2014 8:28 am

Dear Jeff,

I found the class *Tinativo()* for Log Off (alike screen server by Timer), then by specific time in setup I will auto Log Out (Quit) The program if the user do not touch mouse or keyboard after specific time.
- User A - leave the counter for 5 minutes
- automatic Log-Off (Activate Login Screen)
- after 5 minutes for example
- automatic Log-Out (Quit the program)

I fix the case of user do not quit the program in network environment and then the other user cannot run the end day procedure and maintenance files (all station must close before run it).

Thanks,
Dutch
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1543
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 53 guests