Using WinRT from Node.js - windows

WinRT makes its full API available to Windows 8 & Windows Server 2012 JavaScript apps.
Is it possible for a node.js app running on Windows Server 2012 to get access to this API?
I am asking because not all low level node modules support Windows (e.g. to query metrics) and with WinRT you could access the OS directly.
#Roger Rowland - I'm not sure your information is entirely correct.
MSDN says WinRT can be used in non Store Apps - see "Managed desktop apps and Windows Runtime"

As mentioned above - WinRT APIs could be called from regular desktop apps.
So you can write a native node.js addon which consumes WinRT apis to expose them to javascript.
The Javascript Apps in windows 8 uses a different javascript engine (Microsoft's Chakra) & host than node.js, thus you don't get the "built in" support that apps get.
If you are interested in calling WinRT APIs fron node.js -
We'eve just recently open sourced a new project called NodeRT, which automatically generates node.js native addons which exposes the WinRT APIs into node.js (in the method which is described above): https://github.com/NodeRT/NodeRT
Using this, you should be able to call WinRT APIs from inside node.js.

Related

Which SDK to use WinUI3 or UWP for a native windows app?

For building a native windows app which can launch multiple web applications in a webview , i have tried a poc using WinUI3 .Main usecase for this is usb peripheral integrations from the webapps loaded in webview and Single Sign On . Reading more on microsoft documentation , i see some features not supported and some slowness compared to UWP. Do i need to go with UWP for a new app or is the recommendation to go with WInUI3 for a new app development .
Supported Feature List Doc - https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/migrate-to-windows-app-sdk/what-is-supported
Can see WebAuthenticationBroker also in not supported list .
Any guidance on what sdk to use . UWP or WinUI3
WinUI3 is the new technology for Windows Desktop. Although it is not perfect now, but it will be improved. Currently, not all the WinRT APIs are able to be used in WinUI3 apps, but you could use win32 APIs to achieve what you want. So I'd suggest you use WinUI if you are familiar with win32 API can you use win32 API to bypass the limitations.
Compared to WinUI3, UWP is more stable. UWP could use all the WinRT APIs. But some features on UWP are not up to date. For example, some features from WebView2 controls are missing on UWP but available on WinUI like print. Another thing is that UWP apps have limitations like system isolation for accessing local files and local network resources.

Synchronizing Desktop App Converter app settings across devices

Roaming settings options FAQ in Microsoft documentation says:
The Desktop Bridge helps you bring your existing Windows desktop apps to the Universal Windows Platform. From here, minimal code changes will be required to take advantage of Azure AD app data roaming. The Desktop Bridge provides your apps with an app identity, which is needed to enable app data roaming for existing desktop apps.
But there's no mention of what the "minimal code changes" are.
Should the app make use of Windows.Storage.ApplicationData.Current.RoamingSettings API? I use C++ Win32. Do I need to load .NET framework to use the API? Or is there Win32 alternative?
Should the app make use of Windows.Storage.ApplicationData.Current.RoamingSettings API? I use C++ Win32. Do I need to load .NET framework to use the API? Or is there Win32 alternative?
First, I want to let you know that not all UWP APIs are available for the general desktop app. Please check the UWP APIs available to a packaged desktop app (Desktop Bridge) and UWP APIs callable from a classic desktop app
Then, please see Enhance your desktop application for Windows 10 for more details.
In addition:
Some Windows 10 experiences (For example: a touch-enabled UI page) must run inside of a modern app container . If you want to add these experiences, extend your desktop application with UWP projects and Windows Runtime Components.
Please also check Extend your desktop application with modern UWP components document for more reference.

Can I use glib in WP8, WP8.1 or W10M?

How can I use glib in Windows Phone 8 / 8.1 or Windows 10 Mobile C / C++ application? Is it possible?
Should I somehow try to use autotools or should I create Visual Studio project and add all the files needed?
Windows Store apps rely on Windows Runtime and run in sandboxed environment. GLib provides the core application building blocks for libraries and applications written in C. It provides the core object system used in GNOME, the main loop implementation, and a large set of utility functions for strings and common data structures. For Winows Store apps, there are some limitations or restrictionsin security, inter-app communication, low-level system functionality, usable APIs, etc.. If you wanna port your app based on Glib to Windows Store app, you'd better leverage the power of Windows Runtime and other high-quality third party libraries specific to Windows Store.

How do I write a Windows 10 universal class library that references native code?

I have a C# class library that references and wraps Win32 native methods. But I can't seem to port this code over to a newer "universal" C# class library. What do I need to do in order to properly marshal these native methods?
Windows 10 Universal Applications run under the Windows Runtime API, a new "native" API for Windows. Applications using this API run in a sandbox which limits their access to devices and operating system services. While Win32 APIs can be accessed like normal, for example using P/Invoke in the case of C# code, the sandbox only permits the use of certain API functions:
Windows Runtime apps can use a subset of the Win32 and COM APIs. This
subset of APIs was chosen to support key scenarios for Windows Runtime
apps that were not already covered by the Windows Runtime, HTML/CSS,
or other supported languages or standards. The Windows App
Certification Kit ensures that your app uses only this subset of the
Win32 and COM API. In a native app, you can call these APIs directly.
In a managed app, you can call them via a Windows Runtime Component,
or via P/Invoke.
...
The documentation for each programming element in the API indicates
whether it can be used in a Windows Runtime app. See the "Applies to"
line at the top of the page.
So for example FormatMessage works with Windows Runtime, but GetNamedPipeInfo doesn't.
If the Win32 API you want to use isn't one of the ones supported by Windows Runtime, I believe your only option is to have your class library target traditional desktop apps.

How to include windows azure mobile feauture in c++/cx windows 8 application?

I am making windows 8 application using c++/cx but i am not able to get how to include azure feature in my app,every where tutorials is given in c# but nowhere i can find tutorial in c++/cx.
As most of the samples written in managed code to access Windows Azure Mobile Services, It is trues that there are no samples available in C++/C. However it does not mean you could not do it. Keep in mind you would need to do extra work to get it done.
As Windows Azure Mobile Services use RESTful interface so you can access them from any language as long as you can call REST api from there. Here is the documentation for Windows Azure Mobile Services REST Api.
With C++/C you just need to search and find an appropriate framework to call REST api and once you have that working just call Windows Azure Mobile TEST Api to achieve your objective.
This blog post has some examples of how to perform various Azure Mobile Services tasks using C++ for Windows 8.1 Store apps. The IDE tooling mentioned in that post is not available for Windows 8 apps.

Resources