Created
January 26, 2023 07:55
-
-
Save smourier/46c65ffa0db45a4122dae6c82909aaa1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private async Task OpenCapturePicker() | |
| { | |
| var picker = new GraphicsCapturePicker(); | |
| var handle = new WindowInteropHelper(this).Handle; | |
| var interop = (IInitializeWithWindow)(object)picker; | |
| interop.Initialize(handle); | |
| await picker.PickSingleItemAsync(); | |
| } | |
| [ComImport, Guid("3E68D4BD-7135-4D10-8018-9FB6D9F33FA1"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] | |
| private interface IInitializeWithWindow | |
| { | |
| void Initialize(IntPtr hwnd); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment