FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Check if user Locked/Unlocked Windows from my Software
Posts: 99
Joined: Thu Aug 02, 2012 03:21 PM
Check if user Locked/Unlocked Windows from my Software
Posted: 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
Posts: 99
Joined: Thu Aug 02, 2012 03:21 PM
Re: Check if user Locked/Unlocked Windows from my Software
Posted: Sat Apr 22, 2017 05:38 PM

+Up

Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)

FiveWin Version: FWHX 15.01

BCC 5.8.2
Posts: 99
Joined: Thu Aug 02, 2012 03:21 PM
Re: Check if user Locked/Unlocked Windows from my Software
Posted: Thu Apr 27, 2017 01:32 AM

Up!++

Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)

FiveWin Version: FWHX 15.01

BCC 5.8.2
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Check if user Locked/Unlocked Windows from my Software
Posted: Fri Apr 28, 2017 06:53 PM
I don't know if this will work, but try this:

Code (fw): Select all Collapse
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
Posts: 99
Joined: Thu Aug 02, 2012 03:21 PM
Re: Check if user Locked/Unlocked Windows from my Software
Posted: Sat Apr 29, 2017 11:39 PM
James Bott wrote:I don't know if this will work, but try this:

Code (fw): Select all Collapse
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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Check if user Locked/Unlocked Windows from my Software
Posted: 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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Check if user Locked/Unlocked Windows from my Software
Posted: Sun Apr 30, 2017 04:47 AM

Mr James
Wonderful idea :-)

Regards



G. N. Rao.

Hyderabad, India
Posts: 99
Joined: Thu Aug 02, 2012 03:21 PM
Re: Check if user Locked/Unlocked Windows from my Software
Posted: 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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Check if user Locked/Unlocked Windows from my Software
Posted: 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
Posts: 99
Joined: Thu Aug 02, 2012 03:21 PM
Re: Check if user Locked/Unlocked Windows from my Software
Posted: 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

Continue the discussion