Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Powerpoint Slideshow Controller

0.00/5 (No votes)
8 Aug 2009 1  
Powerpoint Slideshow Controller using lasergesture and Motion Detector

Introduction

using your webcam for slideshow presentation, you can slide forward and backward using laser gesture, by moving it from left to right or vice versa.

Codesnipt:

// Code for controlling PowerPoint SlideShow
        private void ControlPowerPoint(string gesture)
        {
            IntPtr powerPointHandle = FindWindow(null, "PowerPoint Slide Show - ["+slideName+"]");
            
            // Verify that PPS is a running process.
            if (powerPointHandle == IntPtr.Zero)
            {
                System.Windows.Forms.MessageBox.Show("Slide Show not running");
                return;
            }
            switch (gesture)
            {
                case "LEFT":
                    SetForegroundWindow(powerPointHandle);
                    SendKeys.SendWait("p");
                    Beeper.RecognizedBeep();
                    break;
                case "RIGHT":
                    SetForegroundWindow(powerPointHandle);
                    SendKeys.SendWait("n");
                    Beeper.RecognizedBeep();
                    break;
                case "DIAGONAL2B":
                    SetForegroundWindow(powerPointHandle);
                    SendKeys.SendWait("n");
                    Beeper.RecognizedBeep();
                    break;
                case "DIAGONAL1A":
                    SetForegroundWindow(powerPointHandle);
                    SendKeys.SendWait("n");
                    Beeper.RecognizedBeep();
                    break;
                case "DIAGONAL1B":
                    SetForegroundWindow(powerPointHandle);
                    SendKeys.SendWait("P");
                    Beeper.RecognizedBeep();
                    break;
                case "DIAGONAL2A":
                    SetForegroundWindow(powerPointHandle);
                    SendKeys.SendWait("P");
                    Beeper.RecognizedBeep();
                    break;
                case "UP":
                    SetForegroundWindow(powerPointHandle);
                    SendKeys.SendWait("n");
                    Beeper.RecognizedBeep();
                    break;
                case "DOWN":
                    SetForegroundWindow(powerPointHandle);
                    SendKeys.SendWait("p");
                    Beeper.RecognizedBeep();
                    break;
            }
        } 

its really fun that you can talk to the windows applications and command them with your application whatever was the method to do that but i like it ..

Video Demo:

http://www.youtube.com/watch?v=eEsMmbY8Lcc

 

Finally:

I would like to thank Ashish Derhgawen for his project Laser Gesture,though thanks for Andrew Kirillov for the Motion Detection Algorithms.  

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here