Sorry @Hayden Lawson ...but I would accept your answer if was like this: Currently, there is no possible way to remove YB.
I am talking about removing YB primary in this scenario...
You are capturing you own application window. In this situation security reason is not applicable ... cause you can fetch data from your application as you can like and "steal" user data that user already is entering in same application. (So, not removing YB for capturing other application windows.)
(Also, I am talking about desktop application. NOT UWP)
P.S. Why I need it is Top Secret!!! LOL
But, I will manage..."few" processor clocks more, "few" graphic frame times lost...but, it will work!
It is miracle that Windows.Graphics.Capture even exists!
OK, how long are WPF & DWM there? 15-years? Currently, in WPF there is no possible way to get capture of your own window except using RenderTargetBitmap that is slow and give you not identical render! Especially RenderTargetBitmap fails to render 3D view-port correctly. For classic Win32 window, BitBlt...also slow.
DWM has buffered image of a window...it is just matter of DX copy resource to get the image...like cca 1ms...no rendering needed, it is already here!
Now, after 15 years, there is Windows.Graphics.Capture, that does this, but, of course, here is YB...LOL...15 years slow but you can see the progress! LOL!
(Even Windows.Graphics.Capture is slow...you must initialize is...+100ms price tag. OK, you can pre-initialize it and take hit on memory tag...and for what? For something that is already in DWM memory, 1ms away? LOL!!!)
Sorry Microsoft, that's no PRO.
P.S.S. I need it for effect transformations like... Window (WPF/Win32) live content -> DirectX (2D/3D) HLSL custom effect -> DirectComposition or Visual layer.