65.9K
CodeProject is changing. Read more.
Home

Powerpoint Slideshow Controller

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.09/5 (4 votes)

Jun 9, 2007

CC (ASA 2.5)
viewsIcon

57284

downloadIcon

4686

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.