Ejemplo n.º 1
0
        public static bool IsNotShowInDeviceManager(Windows.Devices.Enumeration.Pnp.PnpObject obj)
        {
            var statusUInt32 = obj.Properties[DEVPKEY_Device_DevNodeStatus] as UInt32?;
            var status       = (DevNodeStatus)statusUInt32.GetValueOrDefault(0);

            return(status.HasFlag(DevNodeStatus.DN_NO_SHOW_IN_DM));
        }
Ejemplo n.º 2
0
        public static async Task <string> GetWindowsVersionAsync()
        {
            if (hcversion != null)
            {
                return(hcversion);
            }
            try
            {
                string   str;
                string[] strArray = { "{A8B865DD-2E3D-4094-AD97-E593A70C75D6},3" };
                Windows.Devices.Enumeration.Pnp.PnpObject halDevice = await GetHalDevice(strArray);

                if (halDevice == null || !halDevice.Properties.ContainsKey("{A8B865DD-2E3D-4094-AD97-E593A70C75D6},3"))
                {
                    str = null;
                }
                else
                {
                    str = halDevice.Properties["{A8B865DD-2E3D-4094-AD97-E593A70C75D6},3"].ToString();
                }
                hcversion = str;
                return(str);
            }
            catch
            {
                return("0.0.0.0");
            }
        }