FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Close program for other windows user
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Close program for other windows user
Posted: Tue Jan 28, 2014 01: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)
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Re: Close program for other windows user
Posted: Tue Jan 28, 2014 01: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. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: Close program for other windows user
Posted: Tue Jan 28, 2014 02: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)
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: Close program for other windows user
Posted: Thu Feb 06, 2014 08: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 2304 / 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)

Continue the discussion