locked
Windows Session events in Windows & WP apps

    Question

  • Hi All,

    Is it possible to capture session events like logoff, lock, shutdown even Windows store apps?

    Also is it possible to capture WP locked / unlocked (not carrier locked/unlocked) event in WP apps? Like if device is in usage or idle?

    Any pointers or help appreciated?

    Thanks,

    Harit Kalathia


    Harit K

    Friday, January 23, 2015 12:14 AM

All replies

  • logon/off SystemTrigger class , SystemTriggerType enumeration  SysteTriggerType.SessionConnected

    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。

    Friday, January 23, 2015 12:32 AM
  • Thanks Bill...

    I am running sample background task application available at https://code.msdn.microsoft.com/windowsapps/Background-Task-Sample-9209ade9

    Is this code correct if I want to run background task when user is present / logged In. It doesn't seem to work for me...

    vartask = BackgroundTaskSample.RegisterBackgroundTask(BackgroundTaskSample.SampleBackgroundTaskEntryPoint,

                                                                      

    BackgroundTaskSample.UserPresentTaskName,

                                                                      

    newSystemTrigger(SystemTriggerType.SessionConnected, false),

                                                                      

    newSystemCondition(SystemConditionType.UserPresent));

               


                                                                      

    BackgroundTaskSample.UserPresentTaskName,

                                                                      

    newSystemTrigger(SystemTriggerType.SessionConnected, false),

                                                                      

    newSystemCondition(SystemConditionType.UserPresent));


    Harit K

    Friday, January 23, 2015 3:01 AM
  • http://files.dotblogs.com.tw/billchung/1501/2015123111334890.zip

    try this sample , it is for WIndows phone 8.1 Windows Runtime, almost same as Windows 8.1 app


    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。

    Friday, January 23, 2015 3:23 AM
  • Bill,

    I am unable to understand what you are doing in your sample app. May be you might have mentioned in comments but those are non-English.

    Based on code I understand that you register "UserSessionBackgroundTask" and popup a msgbox. But I don't see any log.txt (code in UserSessionBackgroundTask.cs) file getting created in app storage folder.

    Please let me know on which event this log file will be created.


    Harit K

    Friday, January 23, 2015 4:29 AM