The screenshot must be taken from the activity. So you need to find the current foreground activity and use CallSub to call a sub in that activity that will take the screenshot.
Once you took the screenshot you can add it as an attachment to the email.
The screenshot must be taken from the activity. So you need to find the current foreground activity and use CallSub to call a sub in that activity that will take the screenshot.
Dim bmp As Bitmap
For Each module As Object In Array (Main, Activity2, AnyOtherActivity)
If IsPaused(module) = False Then
bmp = CallSub(module, "TakeScreenshot") 'there should be a TakeScreenshot sub in each of the activities.
End If
Next
If bmp.IsInitialized Then
...
End If