Closed Avasam closed 1 year ago
Update: It does all work on a Windows 11 machine (I didn't even need to call GraphicsCaptureAccess.request_access_async(GraphicsCaptureAccessKind.BORDERLESS)
when running from whithin VSCode) I did try with and without border to make sure I was actually capturing the window.
Still I think that raising a proper error in Python will be preferable over letting the whole thing hard crash
So the crash only happens on older versions of Windows? Which version specifically?
Version 10.0.19044 Build 19044 (latest Windows 10) Python 3.9.6 winsdk 1.0.0b5
For now I've resorted to checking the version using platform.version
since I can't try-catch
This should be fixed in v1.0.0b7.
This is the error from the Event Viewer:
Minimal repro:
Microsoft's docs does mentions needing to call the following firstGraphicsCaptureAccess.request_access_async(GraphicsCaptureAccessKind.BORDERLESS)
: https://docs.microsoft.com/en-us/uwp/api/windows.graphics.capture.graphicscapturesession.isborderrequired#remarksIf possible, I would ask for python-winsdk to raise an appropriate exception rather than letting the entire application crash silently.
Sidenote,GraphicsCaptureAccess.request_access_async
also throwsOSError: [WinError -2147221164] Class not registered
, but this may or may not be due to the lack of an application manifest declaring thegraphicsCaptureWithoutBorder
. Or because it's Win11 only. I'll need to try both. The former I can do when I bundle my app with PyInstaller.Edit: see coment