I have only been working with C# for a few weeks and I have gotten stuck on a threading issue.
I’ve been building a custom slideshow that implements a .ppt presentation hosted in a winform handled by an independent class. The slideshow switches off with another program that displays dynamic data from a shop floor. This second program needs to be sent a command to enter full screen mode as I do not have access to it’s source code.
Using Setforegroundwindow API I can easily switch between the two applications and control the power point with the COM interface but the transition is choppy with screens resizing. I would like to overlay a blank black winform that fades in and out while this transition occurs. So far I have been unsuccessful in doing this smoothly, I have tried running the fading form and transition on separate threads but I haven’t got it quite figured out. If anyone might have any advice on how to do this it would be much appreciated.
Thank you.
After working through some example code I implemented a background worker that did the trick. For more info From msdn – How to: Use a Background Worker.
I’m trying to find a more reliable way to ensure the F11 command is processed by the application, but for now I’ve put in a Thread.Sleep before the SendKeys.
Please feel free to leave comments or questions.
And the code for the form that fades in and out..