How to take a screenshot with a Simconnect Client written with Managed Code

I am struggling to get the following simple simconnect code to work. I am trying to take a screenshot.


try
{ simconnect = new SimConnect("take screenshot", lHwnd, WM_USER_SIMCONNECT, null, 0);
  simconnect.MapClientEventToSimEvent(EVENTS.SCREENSHOT, "CAPTURE_SCREENSHOT");
  simconnect.AddClientEventToNotificationGroup(GROUPID.PHOTO, EVENTS.SCREENSHOT, false);
                 
  simconnect.TransmitClientEvent(SimConnect.SIMCONNECT_OBJECT_ID_USER, EVENTS.SCREENSHOT,    0, GROUPID.PHOTO, SIMCONNECT_EVENT_FLAG.DEFAULT);
 }

These camera APIs don’t work… they are deprecated… same for recording… I
don’t know why the SDK still even show these functions… and events… R.

Why is MS/ASOBO listing them in their SDK? Shame on MS/ASOBO, please update
your SDK documentation. 2 years since the release of MSFS and SDK is still not
updated. What a lazy organisation.