Check if user Locked/Unlocked Windows from my Software

Check if user Locked/Unlocked Windows from my Software

Postby hebert_j_vargas » Thu Apr 20, 2017 11:40 pm

Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)
FiveWin Version: FWHX 15.01
BCC 5.8.2
User avatar
hebert_j_vargas
 
Posts: 99
Joined: Thu Aug 02, 2012 3:21 pm

Re: Check if user Locked/Unlocked Windows from my Software

Postby hebert_j_vargas » Sat Apr 22, 2017 5:38 pm

+Up
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)
FiveWin Version: FWHX 15.01
BCC 5.8.2
User avatar
hebert_j_vargas
 
Posts: 99
Joined: Thu Aug 02, 2012 3:21 pm

Re: Check if user Locked/Unlocked Windows from my Software

Postby hebert_j_vargas » Thu Apr 27, 2017 1:32 am

Up!++
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)
FiveWin Version: FWHX 15.01
BCC 5.8.2
User avatar
hebert_j_vargas
 
Posts: 99
Joined: Thu Aug 02, 2012 3:21 pm

Re: Check if user Locked/Unlocked Windows from my Software

Postby James Bott » Fri Apr 28, 2017 6:53 pm

I don't know if this will work, but try this:

Code: Select all  Expand view
Function isWindowsLocked()
    Local lLocked:=.f.
    if getForegroundWindow() == 0  // Screen saver or login screen is foreground
      lLocked:=.t.
    endif
Return lLocked

 
James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Check if user Locked/Unlocked Windows from my Software

Postby hebert_j_vargas » Sat Apr 29, 2017 11:39 pm

James Bott wrote:I don't know if this will work, but try this:

Code: Select all  Expand view
Function isWindowsLocked()
    Local lLocked:=.f.
    if getForegroundWindow() == 0  // Screen saver or login screen is foreground
      lLocked:=.t.
    endif
Return lLocked

 
James

Thank's James, It Worked Flawlessly!!!
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)
FiveWin Version: FWHX 15.01
BCC 5.8.2
User avatar
hebert_j_vargas
 
Posts: 99
Joined: Thu Aug 02, 2012 3:21 pm

Re: Check if user Locked/Unlocked Windows from my Software

Postby James Bott » Sat Apr 29, 2017 11:56 pm

Hebert,

Glad to hear it.

I am curious why you needed this? Maybe its something some of the rest of us might use too, if we knew what kind of a problem it solves.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Check if user Locked/Unlocked Windows from my Software

Postby nageswaragunupudi » Sun Apr 30, 2017 4:47 am

Mr James
Wonderful idea :-)
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10206
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Check if user Locked/Unlocked Windows from my Software

Postby hebert_j_vargas » Mon May 01, 2017 12:16 am

James Bott wrote:Hebert,

Glad to hear it.

I am curious why you needed this? Maybe its something some of the rest of us might use too, if we knew what kind of a problem it solves.

James

James I have an application receving messages from other users (not a chat), if the user leave the computer alone, after a while in idle mode Windows will get locked automaticaly and I need to inform other user's that this user is not in from of the desk, so request or messages can be send to other user or operator, that's the reason I need to check if Windows is Locked, and many thank's for you interest.
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)
FiveWin Version: FWHX 15.01
BCC 5.8.2
User avatar
hebert_j_vargas
 
Posts: 99
Joined: Thu Aug 02, 2012 3:21 pm

Re: Check if user Locked/Unlocked Windows from my Software

Postby James Bott » Mon May 01, 2017 12:36 pm

Hebert,

Well, that is a very good use. Congrats on thinking of how to accomplish it!

I'm going to record that in my bag of tricks.

Feel free to make some more contributions here when you come up with ideas like this.

James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Check if user Locked/Unlocked Windows from my Software

Postby hebert_j_vargas » Tue May 02, 2017 12:48 am

James Bott wrote:Hebert,

Well, that is a very good use. Congrats on thinking of how to accomplish it!

I'm going to record that in my bag of tricks.

Feel free to make some more contributions here when you come up with ideas like this.

James

Bag of tricks, hum! I'll take this idea as well, I'm eager to contribute and many thank's James.
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)
FiveWin Version: FWHX 15.01
BCC 5.8.2
User avatar
hebert_j_vargas
 
Posts: 99
Joined: Thu Aug 02, 2012 3:21 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 9 guests