I am developing addin for powerpoint which export and upload video to my server. While video is uploading, I want to show waiting cursor on PowerPoint. I have used this code and this works fine. But if I use timer by this logic code, getting issue that the cursor changes back to default.
var vstoPresentation = Globals.ThisAddIn.Application.ActivePresentation;
vstoPresentation.CreateVideo("path\\to\\filename.mp4");
// Set cursor as hourglass
Cursor.Current = Cursors.WaitCursor;
System.Timers.Timer aTimer = new System.Timers.Timer();
aTimer.Elapsed += new ElapsedEventHandler((s, e) => {
if (Globals.ThisAddIn.vstoPresentation.CreateVideoStatus == PowerPoint.PpMediaTaskStatus.ppMediaTaskStatusDone)
{
// Executing my time-intensive hashing code here...
// uploading video to server
// when upload finished
// Set cursor as default arrow
Cursor.Current = Cursors.Default;
}
});
aTimer.Interval = 5000;
aTimer.Enabled = true;