Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8200749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:33:23+00:00 2026-06-07T06:33:23+00:00

I want to be able to embed a powerpoint presentation into a C# form

  • 0

I want to be able to embed a powerpoint presentation into a C# form (WinForms). Basically we have a 52′ monitor, and the idea is that in one corner we will have a PPT on loop, and then the other 3 corners will be displaying information from the program itself.

I had expected this to be straightforward, but it seems I am mistaken.

I had been advised to use the WebBrowser control, but this doesn’t work and instead treats the powerpoint file as a download, i.e. gives me a “Save, Open” dialog.

Any suggestions?

AK

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T06:33:25+00:00Added an answer on June 7, 2026 at 6:33 am

    You can just run PowerPoint, get the windows handle, and set a new parent window using the SetParent function.


    All you need is the name of the window class of the PowerPoint window, but thanks to Spy++, this is no big deal.

    spy++


    Here’s a screenshot of PowerPoint running ‘inside’ of a custom application:

    PowerPoint


    Full example (taken from here and modified for PowerPoint):

    public partial class Form1 : Form
    {
        public Form1()
        {
            this.Size = new System.Drawing.Size(800, 600);
            this.TopMost = true;
            this.Text = "My Application";
            this.FormBorderStyle = FormBorderStyle.FixedToolWindow;
            Func<bool> run = () =>
                Window.Find(hwnd =>
                {
                    var cn = Window.GetClassName(hwnd);
                    var res = (cn == "PPTFrameClass");
                    if (res)
                    {
                        this.Controls.Clear();
                        Window.SetParent(hwnd, this.Handle);
                        Window.SetWindowPos(hwnd, new IntPtr(0), -8, -30, this.Width + 10, this.Height + 37, 0x0040);
                    }
                    return res;
                });
    
            new Button { Parent = this, Text = "Start" }
                .Click += (s, e) =>
                {
                    if (run() == false)
                        MessageBox.Show("Open PowerPoint");
                };
        }
    }
    
    public static class Window
    {
        public static bool Find(Func<IntPtr, bool> fn)
        {
            return EnumWindows((hwnd, lp) => !fn(hwnd), 0) == 0;
        }
        public static string GetClassName(IntPtr hwnd)
        {
            var sb = new StringBuilder(1024);
            GetClassName(hwnd, sb, sb.Capacity);
            return sb.ToString();
        }
        public static uint GetProcessId(IntPtr hwnd)     // {0:X8}
        {
            uint pid;
            GetWindowThreadProcessId(hwnd, out pid);
            return pid;
        }
        public static string GetText(IntPtr hwnd)
        {
            var sb = new StringBuilder(1024);
            GetWindowText(hwnd, sb, sb.Capacity);
            return sb.ToString();
        }
    
        delegate bool CallBackPtr(IntPtr hwnd, int lParam);
    
        [DllImport("user32.dll")]
        static extern int EnumWindows(CallBackPtr callPtr, int lPar);
    
        [DllImport("user32.dll")]
        static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
    
        [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
        static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
    
        [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
        static extern int GetClassName(IntPtr hWnd, StringBuilder lpClassName, int nMaxCount);
    
        [DllImport("User32", CharSet = CharSet.Auto, ExactSpelling = true)]
        public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndParent);
    
        [DllImport("user32.dll", SetLastError = true)]
        public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int W, int H, uint uFlags);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to take an image that i have already captured
I want to be able to embed certain information into HTML elements (images) without
I have a javascript that I want my users to be able to put
We have an SWF based audio player. We want to be able to embed
I want to embed two QWidgets into a window created using XLib. I have
I want to be able to query or embed the version string set by
I want to be able to do the following actions with a form submit
Currently I have an app with a virtual currency. I want to be able
I have an iframe (same domain), and want to be able to track the
I have 2 AIR applications ( A and B ) that are able to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.