Welcome Guest.   Make a donation to an author on the site December 20, 2014, 07:56:17 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Your Support Funds this Site: View the Supporter Yearbook.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: How to run a script after every win-unlock ???  (Read 5018 times)
hhbuesch
Supporting Member
**
Posts: 2


View Profile Give some DonationCredits to this forum member
« on: December 24, 2009, 07:10:44 AM »

any idea ?

Thanks and mary xmas
Peter
Logged
slowmaker
Supporting Member
**
Posts: 51



Reinventing the wheel can be fun!

View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: January 11, 2010, 01:15:05 AM »

Do you mean session unlocks, as in fast user switching (winkey+L) out, then logging back in?

If so, your script's caller needs to do some request notifications of session state changes and process them.

The only way I know to do that is win api coding:

    1) call WTSRegisterSessionNotification()
    2) catch #WM_WTSSESSION_CHANGE message and check for #WTS_SESSION_UNLOCK flag
                    * if WTS_SESSION_UNLOCK flag is detected, the script should be called
    3) call WTSUnRegisterSessionNotification() before it exits

Logged

WinXP Home SP3 - PSPad 4.5.4
jpprater
Supporting Member
**
Posts: 88



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #2 on: January 11, 2010, 05:31:09 AM »

You can do it in AutoHotkey.
Read this thread from the autohotkey forum.  It tells you how and provides a helpful library.
I know this works because I used it recently in a project at work.

Jon
Logged
slowmaker
Supporting Member
**
Posts: 51



Reinventing the wheel can be fun!

View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: January 11, 2010, 09:37:30 AM »

hhbuesch, this gave me an idea I started coding, not script specific, just:

run_on_unlock.exe <whatever command line you want here>

and then whenever the user comes back in from a session lock, the system will run <whatever command line you want here> verbatim, as if you'd typed it in a console session.

I don't want to step on the toes of whatever project prompted your question. Do you mind if I post a program like that elsewhere on the board?
Logged

WinXP Home SP3 - PSPad 4.5.4
slowmaker
Supporting Member
**
Posts: 51



Reinventing the wheel can be fun!

View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: January 16, 2010, 03:47:19 PM »

For those who are interested, I went ahead with this, over here.

The source is included in the archive.
Logged

WinXP Home SP3 - PSPad 4.5.4
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.031s | Server load: 0.33 ]