Posted by i believe Kristof a long time ago.
A+
jml
#DEFINE APPID "App0002-13"
IIsAppRun(APPID)
FUNCTION IsAppRun( tcUniqueID )
LOCAL llRetVal, lcUniqueID
*** MUST pass an application ID to this function!
IF EMPTY(tcUniqueID) OR VARTYPE( tcUniqueID ) # "C"
MESSAGEBOX( 'An Application Specific Character ID is mandatory' +
CHR(13) ;
+ 'when calling the IsAppRun() function', 4160, 'Developer
Error' )
RETURN .T.
ELSE
*** Strip out any spaces
lcUniqueID = STRTRAN( tcUniqueID, " " )
ENDIF
*** First check for the existence of the Semaphore window
IF WEXIST("_Semaphore_")
RETURN .T.
ENDIF
*** Look for an occurrence of this ID as a Window Name
DECLARE INTEGER FindWindow IN Win32Api AS FindApp String, String
IF FindApp( NULL, lcUniqueID ) > 0
*** We found one! Set Return Value
llRetVal = .T.
ELSE
*** Create a new window with this ID
DEFINE WINDOW _Semaphore_ IN DESKTOP FROM 1,1 TO 2,2 TITLE lcUniqueID
ENDIF
*** Return Status Flag
RETURN llRetVal
On Thu, Sep 17, 2015 at 9:32 AM, Stephen Weeks <[email protected]>
wrote:
> I have a user table and when the user logs in it puts a lock on his/her
> record and removes it when the user exits the syetem, in the event of a
> crash the lock is automatically removed.
>
> On Wed, 16 Sep 2015, at 08:35 PM, Kurt Wendt wrote:
> > Stephen - that's very interesting. When you gave the link - and I checked
> > it out - it wasn't quite clear where you run this command. But, I guessed
> > it was a DOS command - and I tried it myself and it worked. Very
> > interesting - I didn't know you could access the current running Tasks
> > list this way. Very Cool!
> >
> > -K-
> >
> > -----Original Message-----
> > From: ProfoxTech [mailto:[email protected]] On Behalf Of
> > Stephen Russell
> > Sent: Wednesday, September 16, 2015 2:34 PM
> > To: [email protected]
> > Subject: Re: How do I keep an operator from logging in twice from the
> > same computer
> >
> > On Wed, Sep 16, 2015 at 1:17 PM, Wes Wilson <[email protected]> wrote:
> >
> > > I could create a flag but it will still be there if he crashes and
> > > tries to get back in.
> > > Is there not a way to check to see if an exe is running?
> > > -----------
> >
> >
> > I would query the running applications myself.
> >
> > http://ss64.com/nt/tasklist.html
> >
> >
> >
> > --
> > Stephen Russell
> > Sr. Analyst
> > Ring Container Technology
> > Oakland TN
> >
> > 901.246-0159 cell
> >
> >
> > --- StripMime Report -- processed MIME parts --- multipart/alternative
> > text/plain (text body -- kept)
> > text/html
> > ---
> >
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/capqlobxhme-u_wonwdvub528spheqziw68h8ksuxghw5jns...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.