Check if user Locked/Unlocked Windows from my Software
- hebert_j_vargas
- Posts: 94
- Joined: Thu Aug 02, 2012 3:21 pm
Check if user Locked/Unlocked Windows from my Software
Hi, as mentioned on the subject, I searched on msdn SessionSwitchReason.SessionLock, but I'm unable to understand how to implement on harbour+Fwh
Here:
https://msdn.microsoft.com/en-us/librar ... -snippet-1
and
https://msdn.microsoft.com/en-us/librar ... -snippet-1
Please help!
Here:
https://msdn.microsoft.com/en-us/librar ... -snippet-1
and
https://msdn.microsoft.com/en-us/librar ... -snippet-1
Please help!
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)
FiveWin Version: FWHX 15.01
BCC 5.8.2
FiveWin Version: FWHX 15.01
BCC 5.8.2
- hebert_j_vargas
- Posts: 94
- Joined: Thu Aug 02, 2012 3:21 pm
Re: Check if user Locked/Unlocked Windows from my Software
+Up
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)
FiveWin Version: FWHX 15.01
BCC 5.8.2
FiveWin Version: FWHX 15.01
BCC 5.8.2
- hebert_j_vargas
- Posts: 94
- Joined: Thu Aug 02, 2012 3:21 pm
Re: Check if user Locked/Unlocked Windows from my Software
Up!++
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)
FiveWin Version: FWHX 15.01
BCC 5.8.2
FiveWin Version: FWHX 15.01
BCC 5.8.2
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: Check if user Locked/Unlocked Windows from my Software
I don't know if this will work, but try this:
James
Code: Select all
Function isWindowsLocked()
Local lLocked:=.f.
if getForegroundWindow() == 0 // Screen saver or login screen is foreground
lLocked:=.t.
endif
Return lLocked
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
- hebert_j_vargas
- Posts: 94
- Joined: Thu Aug 02, 2012 3:21 pm
Re: Check if user Locked/Unlocked Windows from my Software
Thank's James, It Worked Flawlessly!!!James Bott wrote:I don't know if this will work, but try this:
JamesCode: Select all
Function isWindowsLocked() Local lLocked:=.f. if getForegroundWindow() == 0 // Screen saver or login screen is foreground lLocked:=.t. endif Return lLocked
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)
FiveWin Version: FWHX 15.01
BCC 5.8.2
FiveWin Version: FWHX 15.01
BCC 5.8.2
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: Check if user Locked/Unlocked Windows from my Software
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
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
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Check if user Locked/Unlocked Windows from my Software
Mr James
Wonderful idea
Wonderful idea
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- hebert_j_vargas
- Posts: 94
- Joined: Thu Aug 02, 2012 3:21 pm
Re: Check if user Locked/Unlocked Windows from my Software
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.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
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)
FiveWin Version: FWHX 15.01
BCC 5.8.2
FiveWin Version: FWHX 15.01
BCC 5.8.2
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Re: Check if user Locked/Unlocked Windows from my Software
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
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
- hebert_j_vargas
- Posts: 94
- Joined: Thu Aug 02, 2012 3:21 pm
Re: Check if user Locked/Unlocked Windows from my Software
Bag of tricks, hum! I'll take this idea as well, I'm eager to contribute and many thank's James.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
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)
FiveWin Version: FWHX 15.01
BCC 5.8.2
FiveWin Version: FWHX 15.01
BCC 5.8.2