Questions tagged [windows-runtime]

Windows Runtime (WinRT) is a Microsoft platform architecture that allows applications to run in a sandboxed environment exposing a 'Windows Modern Style' UI/UX. Not to be confused with Windows RT, the edition of Windows 8 for ARM devices; see windows-rt.

Filter by
Sorted by
Tagged with
0 votes
0 answers
37 views

Operation aborted when calling ReadValueAsync()

I have a Bluetooth Low Energy (BluetoothLE) device that sends a value to my C++ WinRT BluetoothLE tool after it receives a specific value. Everything works perfectly when the device is turned on and ...
Alex's user avatar
  • 3
0 votes
0 answers
35 views

RPC_E_CANTCALLOUT_ININPUTSYNCCALL and FileOpenPicker::PickSingleFileAsync

I have the following situation: FileOpenPicker::PickSingleFileAsync triggers Window.Activated event which has a handler that calls LowLagMediaRecording::StartAsync, or LowLagMediaRecording::...
Tom Huntington's user avatar
-3 votes
0 answers
36 views

I need to execute a file.exe with certain commands from my React Native Windows app

I need to execute a file.exe with certain commands. At the begining I thought that this is gonna be an easy task thanks to child-process library from node js. However this library is not available for ...
Talal's user avatar
  • 1
0 votes
0 answers
11 views

CSWinRT Path '16.1' is not a file or directory

I'm trying to do Generate a C# projection from a C++/WinRT component, I'm getting the following error when trying to compile: 2>EXEC : error : Path '16.1' is not a file or directory 2>C:\Users\...
yonutix's user avatar
  • 2,008
0 votes
1 answer
91 views

Saving a System.Drawing.Bitmap to a WinRT StorageFile

I am having a strange issue where I am able to save a System.Drawing.Bitmap to a StorageFile using WinRT APIs when testing my app, but when the app is installed it does not work. Here is the code in ...
Joe Finney's user avatar
0 votes
0 answers
36 views

How to convert a JavaScript string[] to Windows.Foundation.Collection.IIterable<string>?

I'm working on a React Native Windows project, and am using the projected findAllDevicesAsync() method in Windows.Devices.Enumeration namespace. An overload of the function accepts an IIterable as an ...
Sanjay Subramaniam's user avatar
1 vote
1 answer
27 views

Create IMFMediaType using Windows.Media.MediaProperties namespace

Since the namespaces in Windows.Media just use Media Foundation under the hood, I was hoping to create my codecs with the WinRT convenience methods (on AudioEncodingProperties, VideoEncodingProperties)...
Tom Huntington's user avatar
0 votes
0 answers
19 views

AudioFrameInputNode -> AudioFileOutputNode

I want to take uncompressed audio frames (Loopback Recording) and save it to an encoded file. I tried to use the AudioGraph API. I was hoping if AudioGraph.PrimaryRenderDevice was null then the ...
Tom Huntington's user avatar
-2 votes
1 answer
38 views

c++ winrt BluetoothLEDevice::FromIdAsync() results in Access is denied

I am trying to write a c++ winrt application to connect to a Bluetooth LE device similar to the Microsoft example of BluetoothLE. In the example I can connect to the Bluetooth device. However, when I ...
Alex's user avatar
  • 3
0 votes
1 answer
38 views

C# console app template that can call WinRT apis?

The templates I found give me this error error CS0246: The type or namespace name 'Windows' could not be found (are you missing a using directive or an assembly reference?) Searching leads me to ...
Tom Huntington's user avatar
1 vote
1 answer
48 views

Why calling the constructor from a WinRT component from C# Unity script results in NullReferenceException?

I'm working on a Unity plugin which is a C++/WinRT component and when I try to access the runtime class from a Unity C# script, it throws NullReferenceException. Here are the simplified contents of ...
nooway764's user avatar
2 votes
1 answer
42 views

How to convert from float3 to C++/WinRT type?

I'm writing a custom C++/WinRT component which will be consumed from a C# application. Inside this component I have objects that I need to expose to the caller application and these objects have ...
nooway764's user avatar
0 votes
2 answers
131 views

Visual Studio 2022 Target x86 or x64 Causing Error to Appear. Windows Runtime Libraries Disappear

As you can see, when I specify x86 (or x64) here, I get: The type or namespace name 'Devices' does not exist in the namespace 'Windows' (are you missing an assembly reference?) The .NET target is 4.8 ...
P Coltrane's user avatar
0 votes
0 answers
54 views

UWP project in Visual Basic utilizing Dispatcher build correctly but not in .NET Framework 4.8.1

I’m running Visual Studio (2022 (64-bit) – Version 17.6.3) and I have a correctly built UWP project in Visual Basic utilizing a dispatcher for handling Events, as shown in the code below. The UWP ...
HJA's user avatar
  • 1
1 vote
1 answer
66 views

convert system.windows.media.imaging.bitmapsource to microsoft.ui.xaml.media.imaging.bitmapsource

I thought this would be easy (and built-in) but alas not. Does anyone know of a simply way to convert this ? I'm getting the thumbnail of files/folders and using this code (from WPF, now using WinUI 3 ...
David Hitchen's user avatar
-1 votes
1 answer
40 views

Application.Exit and cyclic references

Application.Exit wont close the process. The UI remains interactive. Is this because I have cyclic references? How do I find cyclic references without reasoning about the code?
Tom Huntington's user avatar
0 votes
0 answers
89 views

How to initialize Linux as A2DP sink for a Bluetooth device?

Is there a Linux equivalent to Windows AudioPlaybackConnection I need to set the PC as an A2DP sink? In Windows using the following code would work #include <winrt/Windows.Foundation.Collections.h&...
srilakshmikanthanp's user avatar
1 vote
1 answer
90 views

Maximize does not expand content to the top of the window [Windows MAUI]

I am trying to get a totally maximized Window with .NET Maui 8.0.0preview4, but an empty bar remains where the title-bar used to be. For the example, I've ammended the Maui template by making the &...
Aidan Bailey's user avatar
0 votes
0 answers
21 views

How can I use SystemMediaTransportControls in Go?

I would like to read from Windows, playback information. I have now tried several things in Go, but without success to get the information. I have tried to include the UWP WinRT Api to access the ...
ZanderCodes's user avatar
0 votes
0 answers
35 views

C# WinUI3 Application using a C++ WinUI3 Control?

I have a WinUI3 Application written in C#. I would like to make a WinUI3 control library (separate project/assembly) written in C++. I would then like to use the control written in C++ inside my C# ...
user1757226's user avatar
0 votes
0 answers
24 views

Using types from external library in IDL file

I want to create an IDL file for my COM server and one of the methods use a type that is not a Windows Runtime type. How can I import that namespace that comes from a NuGet repository? My IDL file ...
pedro's user avatar
  • 83
0 votes
0 answers
43 views

How to update progress in UI using IAsyncOperationWithProgress from within a callback

I have following code structure: winrt::Windows::Foundation::IAsyncOperationWithProgress<Transfer::TransferStatus, Transfer::TransferProgress> Windows:: TransferClient::TransferAsync(winrt::...
rsp's user avatar
  • 537
2 votes
1 answer
223 views

Is Windows App Runtime backward compatible

I am working on a WinUI3 application for the desktop application in cpp. I am trying to build the application as a single executable(.exe). So I chose framework dependant unpackaged mode. When we ...
Harshith's user avatar
  • 181
0 votes
0 answers
32 views

Using C# UWP Winmd in a C++ UWP Project crashes unless compiling with UseDotNetNativeToolchain

We have a C# UWP winmd library (no DLL, winmd only) that will be used in a C++ UWP application project. The problem is that if I run the C++ application in Debug it crashes somewhere when trying to ...
user6410441's user avatar
0 votes
0 answers
27 views

how to use C++ - UWP, WINRT methods in C++ - UWP, DLL application

How to call C++-UWP, WINRT methods in C++-UWP, DLL project? or How to call C#-UWP methods in C++-UWP, DLL project? Mainly, i want to call C# methods from C++-UWP, DLL application. Can somebody help ...
Visithra Vengatesan's user avatar
0 votes
0 answers
98 views

How to convert the winrt::ImageSource to OpenCV cv::Mat in C++/winrt?

I want to convert the winrt type ImageSouce to cv::Mat. However, I cannot get the data pointer of the ImageSource. cv::Mat ToMat(winrt::Microsoft::UI::Xaml::Media::ImageSource const& from) { ...
CpTea's user avatar
  • 1
2 votes
1 answer
333 views

How can I edit a Word Document using the windows-rs rust crate?

I developed some code using the python pywin32 package to insert citations into Microsoft Word, and while it does work, I'd like to convert this code into a much more compact and efficient rust ...
Ryguy's user avatar
  • 96
0 votes
0 answers
43 views

StorageFile to FILE handler

Is there a solution to cast a winrt StorageFile object to FILE handler (_iobuf). I am trying to use external code with UWP application in which reading file using fopen gives This functionality is not ...
undo994's user avatar
0 votes
1 answer
50 views

How to access a ListViewItem's property which is in a DataTemplate through code?

I have a xaml file in which I have a ListView (let's call it OuterListView) which I can access by name. OuterListView's ItemTemplate uses a a StaticResource, let's call it a CustomListViewItem. ...
cooktheprogrammer's user avatar
0 votes
2 answers
71 views

Do WinRT Calendar dates occur on the same day?

I have 2 winrt::Calendars, and I know I can Compare them, but that compares the dates down to (presumably) the nanosecond. How can I robustly tell if 2 dates occur on the same day, or same hour, etc ...
citelao's user avatar
  • 4,978
0 votes
1 answer
70 views

How to determine if UWP app is running with windows open?

I tried using IPackageDebugSettings.GetPackageExecutionState, but it returns PES_RUNNING despite no app windows being open, and in the Task Manager "Status" column the exe showing "...
LOST's user avatar
  • 2,964
0 votes
0 answers
67 views

In C++/WinRT, is it possible to defer activation of a composed base class?

Let's say you declare a runtime class that derives from (i.e., composes) a runtime base class. From what I can tell, C++/WinRT will set up your class so that the base class is activated automatically ...
user avatar
0 votes
0 answers
58 views

Nested C++/WinRT runtime classes

I'm trying to pass a nested custom class object in my event handler. However, I'm struggling to find examples or documentation on how to do this for a UWP Windows Runtime Component library project. ...
nocturnalhippo's user avatar
1 vote
0 answers
98 views

How to set up a C++/WinRT class that accepts Win32 structs as method parameters

I'm creating a desktop C++/WinRT project, and I'd like to declare a runtime class, using MIDL 3.0, that accepts certain Win32 types as method parameters. For example, structs like PROPERTYKEY. This ...
user avatar
0 votes
0 answers
84 views

Accessing WinRT APIs from within .NET core app running as service in Windows 11

I'm trying to read the title from the current media session in Windows 10/11. The following example runs fine if I execute it from within the IDE or manually start the published .exe from console. But ...
Seraksab's user avatar
1 vote
1 answer
218 views

How to screenshot an active non-focused window using WinRT

I'm looking for a way to screenshot an active (non-focused) window using its IntPtr, without using user32.dll PrintWindow as it requires running the app as admin. I was able to screen capture using ...
Ben's user avatar
  • 793
1 vote
1 answer
69 views

Windows App SDK: SpeechSynthesizer takes forever to synthesize

As I described here: I have a method async SpeakAsync(string language, string text): var synth = new SpeechSynthesizer(); var player = new MediaPlayer(); SetVoice(language, ref synth); var source ...
AkiraVoid's user avatar
0 votes
0 answers
63 views

Auto-accept confirmation dialog on windows when pairing devices via WiFi Direct?

Using WiFi direct sample at: https://github.com/microsoft/Windows-universal-samples/tree/main/Samples/WiFiDirect Doesn't matter which pairing mode I use i.e. PushButton, Pin, Password. Eventually, ...
tunafish24's user avatar
  • 2,298
0 votes
0 answers
143 views

How to draw WinRT::Windows::UI::Composition::Visual on bitmap

I am trying to draw cppwinrt Lottie animation into my Direct2D app, but can't understand how to do this... It's possible draw this animation (WinRT::Windows::UI::Composition::Visual) and get data ...
Nikolay's user avatar
  • 13
1 vote
0 answers
204 views

IUIAutomationElement to WinRT AutomationElement mapping in C#

I am trying to use Microsoft UI Automation Project. What I understand so far after reading through the Functional Tests, that are part of Project, that IUIAutomationElement needs to be converted to ...
vibhu's user avatar
  • 1,667
0 votes
0 answers
205 views

WinUI3 : How to close a WinUI3 window without stopping the event loop

I'm working on a WinUI3 desktop application in C++. I'm trying to build a multiwindow application that will be still running and accepting events even when all the Windows are closed. In WinUI3, the ...
Harshith's user avatar
  • 181
0 votes
1 answer
282 views

WinUI3 : How to get the WinUI3 window back from its respective HWND

I'm working on the WinUI3 desktop application. I'm trying to set an ID to the winui3 window and get the WinUI3 window back with only the ID. I could not find any direct way to do this. I tried to ...
Harshith's user avatar
  • 181
0 votes
0 answers
130 views

WinUI3 : Incrementally add contents to ListView On scroll

I am working on WinUI 3 desktop application in C++. I was trying to achieve an experience where when we scroll ListView, we will incrementally add rows to the end of the listviews dropdown during ...
Harshith's user avatar
  • 181
0 votes
0 answers
65 views

How launch win32|desktop app from winrt component?

How run for example win32 console app and pass generated arguments to it from WinRt component? The variant via the url scheme is not suitable, because there may be conflicts. Also ...
isrepeat's user avatar
  • 123
0 votes
0 answers
100 views

DX11 texture to DX12 conversion

I am looking for a resource to fetch a DX12 texture from a window. It looks like there is a way to get DX11 via WinRT apis, however I am seeing no methods to up-convert DX11 texture to DX12. I've ...
Kalen White's user avatar
0 votes
0 answers
158 views

Unable to Unwrap/Decode a WinRT.IInspectable object from BluetoothLEAdvertisementWatcher::Received event in Powershell

Thanks to the excellent research work done by @windos on BurnToast, I've been able to use WinRT Runtime in Powershell (7.1+ needed) to receive Bluetooth Low Energy advertisement beacons. What I've ...
Aldo's user avatar
  • 303
0 votes
1 answer
64 views

My UWP VPN app add to username another symbols

I create vpn profile from my UWP app public async void connect() { var config = @" <VPNProfile> <ProfileName>testConnection</...
Leyter's user avatar
  • 5
0 votes
0 answers
123 views

WinUI3 : How to get Aeroplane mode toggle event in WinUI3 desktop Application in C++

I'm working of WinUI3 desktop application in C++. I was searching for a way to receive an event when user toggles airplane mode in windows. I came across a way where where we can check Registry at ...
Harshith's user avatar
  • 181
1 vote
1 answer
162 views

WinUI3 : Handle network change event in WinUI3 desktop with c++

I'm working on the WinUI3 desktop application in C++. I was checking how we can get an event when the network to which system is connected to changes. I came across NetworkInformation....
Harshith's user avatar
  • 181
-1 votes
1 answer
248 views

How to use Windows.UI.ViewManagement.UIViewSettings from WinRT/C++?

We have a pure Win32/C++ app from which we want to be able to detect Tablet Mode on Windows 10. I have the following code which came from somewhere which uses WRL to access the Windows.UI....
Jonathan Potter's user avatar

1
2 3 4 5
174