locked
how I can put windows 8 into Connected Standby mode?

    Question

  • how I can put windows 8 into Connected Standby mode?
    Tuesday, September 11, 2012 8:19 AM

Answers

  • Yasser,

    You will need a system that supports connected standby.

    Best Wishes - Eric

    Tuesday, September 11, 2012 6:36 PM
    Moderator
  • IWDTF2 WDTF = new WDTF2Class();
    IWDTFSystemAction2 Sys = (IWDTFSystemAction2)WDTF.SystemDepot.ThisSystem.GetInterface("System");
    int CSDurationMilliseconds = 20 * 1000;

    Sys.ConnectedStandby(CSDurationMilliseconds);

    Tuesday, September 25, 2012 5:45 PM
    Moderator
  • Try to install WDK run time  

    http://msdn.microsoft.com/en-us/library/windows/hardware/hh831856(v=vs.85).aspx 

    Monday, December 03, 2012 8:26 AM

All replies

  • Yasser,

    You will need a system that supports connected standby.

    Best Wishes - Eric

    Tuesday, September 11, 2012 6:36 PM
    Moderator
  • Hi Eric, 

    I have system supports connected standby. my question how I can sending the system to connected standby like (hibernate). and which Microsoft API do this functionality

    Thanks,

    Yasser

    Wednesday, September 12, 2012 6:12 AM
  • Yasser,

    Connected Standby support has been added to the Windows Driver Test Framework (WDTF) to allow entering and exiting CS programmatically. WDTF supports COM interfaces.  Below are samples in VBScript and JScript:

    VBS

    Set WDTF =  CreateObject("WDTF2.WDTF")

    Set System =  WDTF.SystemDepot.ThisSystem.GetInterface("System")

    System.ConnectedStandby(DurationMS)

    JS

    var WDTF =  WScript.CreateObject("WDTF2.WDTF")

    var System =  WDTF.SystemDepot.ThisSystem.GetInterface("System")

    System.ConnectedStandby(DurationMS)


    Tuesday, September 18, 2012 1:17 AM
    Moderator
  • I am trying to do the same thing using C#

    steps :

    1. referenced the WDTF.Interop.dll and WDTFSystemAction.Interop.dll  located in the WDK path: C:\Program Files (x86)\Windows Kits\8.0\Testing\Development\lib\x64\

    2.  C# code 

     using Microsoft.WDTF;

    namespace ConnectedStandby
    {
        class Program
        {
            static void Main(string[] args)
            {
                var wdtf = new WDTF();

               var system = (IWDTFSystemAction2) wdtf.SystemDepot.ThisSystem.GetInterface("System");

               // system.ConnectedStandby(30000);
            }
        }
    }

    I couldn't found method ConnectedStandby() in these Dlls

    please advice





    Tuesday, September 25, 2012 1:47 PM
  • IWDTF2 WDTF = new WDTF2Class();
    IWDTFSystemAction2 Sys = (IWDTFSystemAction2)WDTF.SystemDepot.ThisSystem.GetInterface("System");
    int CSDurationMilliseconds = 20 * 1000;

    Sys.ConnectedStandby(CSDurationMilliseconds);

    Tuesday, September 25, 2012 5:45 PM
    Moderator
  • I'm tried the above code on Windows 8 x32 and it passed successfully, Unfortunately,  I encountered a problem when  tested this API on Windows 8 x64  the problem is ‘Windows Driver Testing Framework (WDTF) Runtime Libraries-x64’ unable to installed in Windows 8 x64 bits.<o:p></o:p>

    The Windows Driver Kit (WDK) which I used is version 8.59.25584.0. <o:p></o:p>

    How I can solve installation WDTF runtime library problem on Windows8 x64?<o:p></o:p>



    Wednesday, October 03, 2012 11:06 AM
  • hi Eric,

    How I can run this code C# without installed all WDK (1G size) ? I need to use specific dll which do this job .

    Tuesday, October 09, 2012 2:48 PM
  • Hi Eric,

    If am not wrong, WDTF seems to be a separate setup needs to be installed on a client machine and then execute on test machine by connecting to it. Is that my understanding correct ? If wrong could you help me to provide instructions on how to setup WDTF and execute above?

    One more thing, Does the above code helps to wake up system back to normal system after the given duration is elapsed?

    Thanks in advance.

    Friday, November 16, 2012 9:47 AM
  • Hi Yasser,

    Make all the dll's as reference available in the path "C:\Program Files (x86)\Windows Kits\8.0\Testing\Development\lib\x64\" to get the connected standby method.

    Wednesday, November 21, 2012 9:53 AM
  • I read the discussion “how I can put windows 8 into Connected Standby mode?
    And tried the ways:

            1. referenced the WDTF.Interop.dll and WDTFSystemAction.Interop.dll  located in the WDK path: C:\Program Files (x86)\Windows Kits\8.0\Testing\Development\lib\x64\
            2. IWDTF2 imywdtf2 = new WDTF2();
                    IWDTFSystemAction2 sys2 = (IWDTFSystemAction2)imywdtf2.SystemDepot.ThisSystem.GetInterface("System");
                    sys2.ConnectedStandby(30000);

    But then I met the exception when I creating the new IWDTF2 instance:

        Retrieving the COM class factory for component with CLSID {0D972387-817B-46E7-913F-E9993FF401EB} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

    And I also ran the script:

            C:\Program Files (x86)\Windows Kits\8.0\Testing\Samples\WDTF\Tests\vbs\ConnectedStandby\ConnectedStandbyCycles_Sample.vbs

    I also get the feedback:
            Error: ActiveX component can't creat objects:'WDTF2.WDTF'
            Code: 800A01AD

    Of course I tried to register the 2 dlls:
        regsvr32 WDTF.Interop.dll
        regsvr32 WDTFSystemAction.Interop.dll

    But got the errors:
            The Module "C:\Prog......\WDTFSystemActon.Interop.dll" was loaded but the entry-point DllRegisterServer was not found. Make sure that "C:\Prog......\WDTFSystemAction.Interop.dll" is a valid DLL or OCX file and then try again.

    Can any one help me?

    Monday, December 03, 2012 8:16 AM
  • Try to install WDK run time  

    http://msdn.microsoft.com/en-us/library/windows/hardware/hh831856(v=vs.85).aspx 

    Monday, December 03, 2012 8:26 AM
  • Hi Eric, 

    I have installl WDK with

    http://msdn.microsoft.com/en-us/library/windows/hardware/hh831856(v=vs.85).aspx 

    But I got a accessviolation in


    var system = (IWDTFSystemAction2) wdtf.SystemDepot.ThisSystem.GetInterface("System");

    the error msg is:

    "An unhandled exception of type 'System.AccessViolationException' occurred in WindowsFormsApplication1.exe Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt."


    I have no idea about this.

    Hammerstorm

    Tuesday, December 04, 2012 7:14 AM
  • Hi Hammer Storm,

    Try to make your class PUBLIC type. I guess this access violation occurs in unmanaged or unsafe code when the code attempts to read or write to memory that has not been allocated, or to which it does not have access. 


    Wednesday, December 05, 2012 6:38 AM
  • Hi, man,

    I failed in step to create a IWDTF2  instance, but I find you had passed it.

    Can you give a help about your configuration of whole environment?

    And how do you create the  "wdtf" instance?

    thank you.

    Wednesday, December 05, 2012 8:25 AM
  • Hi,

    After installing the WDK, you need to import the assemblies available in this path "C:\Program Files (x86)\Windows Kits\8.0\Testing\Development\lib\x64\"

    Then import the namespace ' Using Microsoft.WDTF;' before creating an instance.

    Wednesday, December 05, 2012 8:50 AM
  • Yes, a imported the reference of WDTF.Interop.dll and WDTFSystemAction.Interop.dll under the path.

    And I used "Using Microsoft.WDTF" of course.

    Even the application build successful.

    I installed WDK runtime in target machine.

    But it still failed in running, give me a message as:

    Retrieving the COM class factory for component with CLSID {0D972387-817B-46E7-913F-E9993FF401EB} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)),

    though I can find the class in HKey_Classes_Root path and by the key I can find the dll WDTF.dll is really in there.

    and the samples "N:\Program Files (x86)\Windows Kits\8.0\Testing\Samples\WDTF\Tests\vbs\ConnectedStandby\ConnectedStandbyCycles_Sample.vbs" even can work smooth......

    Can you help me?

    Wednesday, December 05, 2012 9:39 AM
  • Hi,

    Try to check the dll path which you have imported from whether x86 or x64. It should match according to your 32-bit or 64-bit OS architecture. 

    Also try to import other dll's of WDTF like WDTFSystemAction.interop.dll & import other dll's too if it didn't worked. 

    Thursday, December 06, 2012 3:42 AM
  • Eric,

    On an HP Windows 8 tablet, if we install the WDTF, we can no longer lock the computer by pressing <windowskey>-L, or by <ctrl><alt><del>, or by selecting the user in the upper-right corner of the Metro UI.

    Is there a patch for this problem somewhere?

    Monday, January 21, 2013 11:01 PM
  • hi Eric,

    i tried your code here on C# but i face error on IWDTF2 WDTF = new WDTF2Class();

    error CS1752: Interop type 'Microsoft.WDTF.WDTF2Class' cannot be embedded. Use the applicable interface instead.
    error CS0143: The type 'Microsoft.WDTF.WDTF2Class' has no constructors defined

    i have have referenced both dll files(WDTF.Interop.dll and WDTFSystemAction.Interop.dll) and added "using Microsoft.WDTF;"

    please advice:)

    Friday, February 08, 2013 8:58 AM
  • Hi ldbdh

    I have a Win8 Tablet, but i was able to lock my system <Windows Key> + <L> . There is no dependency of locking the system with WDTF runtime libraries installed.

    Tuesday, February 26, 2013 10:22 AM
  • Hi,

    Were you able to resolve this issue, we are also seeing same issue. Let us know the solution if you were able to resolve this issue.


    Tuesday, May 07, 2013 2:53 PM