Click here to Skip to main content
Click here to Skip to main content

Powerpoint Slideshow Controller

By , 8 Aug 2009
Rate this:
Please Sign up or sign in to vote.

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, along with any associated source code and files, is licensed under The Creative Commons Attribution-ShareAlike 2.5 License

About the Author

Waheed AL Barghouthi
Web Developer
Jordan Jordan
Waheed Al-Barghouhi
http://waheedbarghouthi.blogspot.com

Comments and Discussions

 
Questionslideshow with arrow key navigation - looking for sample code Pinmembermganesh21-Feb-14 16:23 
QuestionSlideshow? Pinmemberkienhv_8715-Jun-10 23:38 
GeneralDynamic XML template-based PowerPointCreator in C# PinmemberElmue29-Aug-08 13:06 
GeneralThis is the same as Ashish Derhgawen article PinmemberSacha Barber10-Jun-07 0:50 
GeneralRe: This is the same as Ashish Derhgawen article [modified] PinmemberWaheedi10-Jun-07 4:08 
GeneralRe: This is the same as Ashish Derhgawen article PinmemberSacha Barber11-Jun-07 0:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.140415.2 | Last Updated 8 Aug 2009
Article Copyright 2007 by Waheed AL Barghouthi
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid