Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I've actually found a better framework than the <code>SmartDevice</code> framework. Inside the <code>C:\Program Files (x86)\Microsoft XDE\8.0</code> folder you can find the <code>Microsoft.XDE</code> DLLs, which help power the Windows 8 simulator wrapper/skin, and are managed libraries that allow you to interact with the simulator. Sample code:</p> <pre class="lang-cs prettyprint-override"><code>private static void BootViaXdeLibs() { var factory = new Microsoft.Xde.Wmi.XdeWmiFactory(); Console.WriteLine("Polling for virtual machines"); var virtualMachine = factory.GetAllXdeVirtualMachines(SettingsOptions.None)[2]; Console.WriteLine("Found machine {0}", virtualMachine.Name); if (virtualMachine.EnabledState != VirtualMachineEnabledState.Disabled) { Console.WriteLine("Virtual Machine {0} is already running. Shutting down. ", virtualMachine.Name); virtualMachine.Stop(); while (virtualMachine.EnabledState != VirtualMachineEnabledState.Disabled) { Thread.Sleep(1000); } } Console.WriteLine("Starting {0}", virtualMachine.Name); virtualMachine.Start(); while (virtualMachine.EnabledState == VirtualMachineEnabledState.Starting) { Thread.Sleep(1000); } Console.WriteLine("Sleeping before image capture to give boot time"); Thread.Sleep(30000); //Click on the screen virtualMachine.SendMouseEvent(new MouseEventArgs(MouseButtons.Left, 1, 295, 260, 0)); Thread.Sleep(100); virtualMachine.SendMouseEvent(new MouseEventArgs(MouseButtons.None, 0, 295, 260, 0)); Thread.Sleep(1000); Console.WriteLine("Saving screenshot"); //Capture Screen var res = virtualMachine.GetCurrentResolution(); var image = virtualMachine.GetScreenShot(0, 0, res.Width, res.Height); image.Save("C:\\image.png", ImageFormat.Png); virtualMachine.Stop(); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload