Calling Windows 10 APIs from a WinForms or WPF application
blogs.windows.com
Calling Windows 10 APIs from a WinForms or WPF application
1–10 of 71 posts
Re: Calling Windows 10 APIs from a WinForms or WPF application
#2Although, I never got Intellisense working in VS if I declare #using in C++/Win32 projects.
A simpler and a lot more interesting alternative (for Win32) is the excellent cppwinrt library[1]
[0] https://software.intel.com/en-us/articles/using-winrt-apis-f...
Re: Calling Windows 10 APIs from a WinForms or WPF application
#3Re: Calling Windows 10 APIs from a WinForms or WPF application
#4Just the same, it's cool that it can be added without having to completely migrate/rework an application.
Re: Calling Windows 10 APIs from a WinForms or WPF application
#5Some Apple docs for comparison: https://developer.apple.com/library/content/samplecode/Metal...
Re: Calling Windows 10 APIs from a WinForms or WPF application
#6My only concern would be supporting older versions of windows while utilizing features where available. Would have been cool to see an example of doing this in the article. Just the same, it's cool that it can be added without having to completely migrate/rework an application.
Re: Calling Windows 10 APIs from a WinForms or WPF application
#7Similar tricks[0] can be used on Win32 applications. Although, I never got Intellisense working in VS if I declare #using in C++/Win32 projects. A simpler and a lot more interesting alternative (for Win32) is the excellent cppwinrt library[1] [0] https://software.intel.com/en-us/articles/using-winrt-apis-f... [1] https://github.com/Microsoft/cppwinrt
Re: Calling Windows 10 APIs from a WinForms or WPF application
#8My only concern would be supporting older versions of windows while utilizing features where available. Would have been cool to see an example of doing this in the article. Just the same, it's cool that it can be added without having to completely migrate/rework an application.
This is nice because it encapsulates both OS version API differences and device capabilities.
https://blogs.windows.com/buildingapps/2015/09/15/dynamicall...
using Windows.Foundation.Metadata;
if(ApiInformation.IsTypePresent("Windows.Media.Playlists.Playlist"))
{
await myAwesomePlaylist.SaveAsAsync( ... );
}
if(ApiInformation.IsApiContractPresent("Windows.Media.Playlists.PlaylistsContract"), 1, 0)
{
// Now I can use all PlayList APIs
}Re: Calling Windows 10 APIs from a WinForms or WPF application
#9I'm all web now, and I love it too, but sometimes I just wish I could go back to the good old WPF days!
The extensive tooling involved with frontend web development and the constant religious wars between frameworks can get exhausting.
Re: Calling Windows 10 APIs from a WinForms or WPF application
#10My only concern would be supporting older versions of windows while utilizing features where available. Would have been cool to see an example of doing this in the article. Just the same, it's cool that it can be added without having to completely migrate/rework an application.
The Windows 10 API provides API availability checks. So you target the latest version but then add checks to see what API's are available. This is nice because it encapsulates both OS version API differences and device capabilities. https://blogs.windows.com/buildingapps/2015/09/15/dynamicall... using Windows.Foundation.Metadata; if(ApiInformation.IsTypePresent("Windows.Media.Playlists.Playlist")) { await myAwesomePl…