c# Windows update API windows 10? - c#

This is a simple question, I've used the old wuapilib.dll for windows 7, but I'm unable to find anything to use to programatically call / use windows updates in Windows 10. Did Microsoft do away with this functionality?

You can still use WUApi in Windows 10. Just add the reference.
The path is C:\Windows\System32\wuapi.dll

Related

How to change the current Windows theme programatically in windows 8.1?

From Windows XP to Windows 7, you could change the current the with the command line: (How do I change the current Windows theme programmatically?). But in Windows 8.1 (and windows 8 I suppose), it doesn't work.
The only way I can do it is with WinaeroThemeSwitcher (http://winaero.com/comment.php?comment.news.209).
How can I do it from native commands or from C#? WinaeroThemeSwitcher proves that it is possible.
I finally found how. Using ILSpy (with few corrections) helped a lot. Thank you magicandre1981.
I also found an implementation online afterwards using COM objects GUID (class ThemeManagerHelpClass):
https://github.com/opkorz/CS199_Thesis/blob/master/Implementation1/CL_Utility2.ps1

Windows phone 8 application type?

I have a couple quick questions about Windows Phone applications. How does one know the type of Windows Phone application? For example, is the WP email client XAML or Silverlight?
The reason I am asking is that I have been assigned the task of writing some automated testing scripts for an already developed application (or WP core app) and I'm not sure which automated scripting method to use (CodedUI vs VSTO Test UI). It's my understanding that CodedUI only works for XAML based applications.
Thanks!
From just looking at the app I don't think there is anyway to tell. However, whether it is SilverLight or new Store App (appx) they both support XAML. If you have the source code you can load it in Visual Studio. After the project name you will see:
Windows Phone 8.1 Silverlight
Windows Phone 8.1
The second one is the newer Store App possibly a Universal App.
If you need to know if it is xaml then certianly asking the developer will be the easiest option. I assume they are both XAML no matter what as I am not aware that WinJS is supported for phone.
One other option that could help you get to what you need to know is if you have the executables. Silverlight will be an XAP file extension and the new Store App will be have an APPX file extension.
Good luck & Have fun,
Tom

How do I use Windows.Storage.FileIO.WriteFileAsync in Windows 8.1?

I'm trying to write a text file to the roaming folder in my Windows 8.1 app. However, all the tutorials I've been able to find were written for Windows 8 and use the Windows.Storage.FileIO.WriteFileAsync method which is no longer available in Windows 8.1 apparently. What is the equivalent method for this in 8.1?
Here's the code I have so far, I just don't know what do afterwards to write the file because of the apparent change in APIs:
var applicationData = ApplicationData.Current;
var roamingFolder = applicationData.RoamingFolder;
await roamingFolder.CreateFileAsync("file.txt", CreationCollisionOption.GenerateUniqueName);
I've never heard of Windows.Storage.File.IO.WriteFileAsync. You're probably looking for Windows.Storage.FileIO which has WriteBytesAsync, WriteTextAsync, etc.
I figured out the issue. When I used that method in Windows 8, I would type in the full Windows.Storage.FileIO line, but now in Windows 8.1, I only need to type in File.IO.WriteTextAsync() and it'll work. The Windows.Storage part is no longer needed in Windows 8.1 it seems.

How to detect if an app is running on Windows RT or Windows 8 Pro?

I'm developing an app for Windows 8, but I want to know if there's a way to know the version of Windows 8, because if it's Windows 8 RT I want the app only shows 2 options, for example, but if the app is running on Windows 8 Pro I want the app has the total functions.
I know when you create the packages in Visual Studio you can select the type or architecture you want for the app, but I don't know if with C# or JavaScript in the case of an app with HTML5 you can detect the architecture to know the version of Windows 8.
I think you are mixing the meanings of architecture and OS version.
OS version you are looking for is actually a Windows Edition and it has nothing to do with CPU architecture.
As for your question, I think you are looking for this:
using System.Management;
var name = (from x in new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem").Get().OfType<ManagementObject>()
select x.GetPropertyValue("Caption")).FirstOrDefault();
return name != null ? name.ToString() : "Unknown";
taken from here
Regarding JavaScript I'm pretty sure that at least for now there is no way to know the edition.
I don't know if the RT part comes through, but this blog has an example of extracting OS information using the kernel32.dll in C#.
chsarp411 Tutorial
Stackoverflow Posting

How to make DeskBands work on Windows 7 x64?

I'm going to create an application (C#), which has its DeskBand on the Windows TaskBar. I've found one complete example program, which does this, but I didn't manage to successfully install (add to Toolbars menu on the taskbar) it. I think, it's because my Windows is x64, there are no other visible reasons...
So, my question is how to create and add a deskband to Windows 7 x64 taskbar?
According to Microsoft, Deskbands are not recommended for Windows 7, although they still work. Also keep in mind that Microsoft requires that Deskbands support Aero on Windows 7 via IDeskband2 Interface, rather than IDeskband. Also, Micorosft has officially said that IDeskBand2 may be altered or unavailable in subsequent versions of the operating system or product.
Finally, be very careful about creating shell extensions in managed code.

Categories

Resources