CryptMsgControl

[DllImport("Crypt32.dll", SetLastError = true)]
public static extern bool CryptMsgControl(
   IntPtr hCryptMsg,
   uint dwFlags,
   uint dwCtrlType,
   IntPtr pvCtrlPara
);

Microsoft documentation: Link

Last updated