So I am creating a program to debug my screen going black randomly by creating a key bind to then save all the event viewer events from the past few seconds to find a pattern in what events led up to it going black. Through this I want to access the actual human readable message that event viewer shows when clicking on a event. I am using CoPilot to find suitable libraries, classes and functions etc but now I'm stuck.
https://paste.pythondiscord.com/UFFA
Line 24 is what is causing the issue, the except statement says that EvtFormatMessage wants to have a third argument that is a flag and that it should be a int, but I can't find its definition so I only have CoPilot to rely on which has given me the exact same solution 3 times in a row (just with more print statements added each time). So how should I access the actual event message through py?