Comments (10)
It seems that you're failing the QI to get the IGraphicsCaptureItemInterop interface. Which version of Windows are you running? This feature was added in the 1903 update.
from windows.ui.composition-win32-samples.
I have OS Build 10.0.17763.557
I will try it again after updating and will let you know if the issue resolved
from windows.ui.composition-win32-samples.
Hello, after I updated the example works. Good. is there an otption to not capture the mouse pointer?
And now I have another issue with the API function DwmRegisterThumbnail from here:
https://docs.microsoft.com/en-us/windows/win32/api/dwmapi/nf-dwmapi-dwmregisterthumbnail
My program makes some big use with this function and after this update the function is not working as expected. Please see the issue I reported to Microsoft:
I know that the issue is not related to this. I just don't know where to get the support.
Please let me know where to get support about this issue. I am not sure that I reported it in the right place.
The issue is big and it broke something in my program...
Please help me to get support about this.
Thanks
from windows.ui.composition-win32-samples.
Glad to hear the sample is working. The current Insider builds have an API we plan to add that makes the cursor rendering configurable. Look for a new property on GraphicsCaptureSession
named IsCursorCaptureEnabled
.
As for your issue with DwmRegisterThumbnail, what exactly are you having a problem with? Multiple thumbnails that are assigned to a single window, or the same thumbnail (or at least thumbnails targeting the same window) across multiple windows? I tried both just now and couldn't reproduce any issues. What would I do to reproduce this?
from windows.ui.composition-win32-samples.
Hello, I think that the problem is when you use the API via DLL file.. I could reproduce the bug only by using the API from a script that written in Autoit.
Please try to run this code:
https://pastebin.com/MNABim8w
Note that you will need to update the target window to display a preview for in line:
$targetGUI = HWnd(0x000000000002004C)
The problem is that you will see only one window getting the live preview. it did not happned before the update.
The preview 2 window don't get a live preview. Only the first one.
If I will remove this line that create the first preview:
$handle1 = RegisterWindowLivePreview($targetGUI,$hGUI1)
The second preview will work.
I think that the problem is because the API returns the same HTHUMBNAIL twice.
The this line:
$aRet = DllCall("dwmapi.dll", "int", "DwmRegisterThumbnail", "hwnd", $hwnd, "hwnd", $hWndOw, "ptr*", DllStructGetPtr($tID))
Will call to this function. the function returns the ID 1 even the second time. I think that this is the bug..
But in C++ version I did not saw this. The ID was 2 on the second call and not 1.
from windows.ui.composition-win32-samples.
It seems that you did some change in dwmapi.dll in this update.
It seems that this dll now stores some global memory for the HTHUMBNAIL ID.
I know this because I found the solution.
The solution is open the dll file using:
$dwmDll = DllOpen('dwmapi.dll')
And then in any line that calls the dll, I need to use the dll handle $dwmDll
So instead of
DllCall('dwmapi.dll', ...
I write
DllCall($dwmDll, ...
This was solved the issue and now the script print different HTHUMBNAIL on the second call as expected.
from windows.ui.composition-win32-samples.
That seems like there was a behavior change in Autoit, I can't get this to happen in C++. Glad everything was sorted out for you.
from windows.ui.composition-win32-samples.
Hi gileli121 - I wanted to comment on your question re: mouse cursors. Insider preview builds 18894 or greater have a new property on GraphicsCaptureSession named IsCursorCaptureEnabled. Release notes are here.
from windows.ui.composition-win32-samples.
Thanks.
Will be also an option to remove the yellow frame of the window that under capture mode?
from windows.ui.composition-win32-samples.
@robmikh I am seeing this error in the latest version of Windows 10 LTSC 1809 (17763.1728).
Am I out of luck?
from windows.ui.composition-win32-samples.
Related Issues (20)
- Some samples use `WindowsRuntimeMarshal` class, that is no longer available in .NET 5+ HOT 4
- Cannot use IGraphicsCaptureItemInterop::CreateForWindow with electron apps HOT 6
- This repo is missing important files HOT 4
- How to capture Windows10/11 Virtual Desktop via Windows.Graphics.Capture ? HOT 2
- Accessing screen capture image bytes with MapFlags.DoNotWait for better CPU usage HOT 3
- Can I do successive captures on two different windows HOT 8
- ScreenCapture Sample - write capture stream to disk mp4? HOT 5
- Capture area of a monitor HOT 4
- Memory Leak? HOT 5
- BSODs on 4 separate Hard Drives HOT 3
- Multiple screen captures in a loop cause explorer.exe and native Windows app to lag? HOT 11
- Capture OnFrame Callback very slow on Win11 23H2 HOT 7
- access_denied in CreateForMonitor in some cases HOT 5
- Cannot catch errors in CreateCaptureItemForWindow HOT 3
- WGC CaptureFrame returns wrong SystemRelativeTime in window capture mode HOT 2
- Cursor may become invisible when recording some fullscreen games using WGC HOT 6
- Frame has issue after change window state (maximize from normal/ normal from maximize/ ...) HOT 1
- ScreenCaptureforHWND sample leaks handles leading to "Out of memory" crash HOT 1
- ScreenCaptureforHWND sample main thread hang HOT 2
- ScreenCaptureforHWND: How to get the byte data of the captured frame? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from windows.ui.composition-win32-samples.