Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Embed Powerpoint window inside window / dialog

109 views
Skip to first unread message

Roland

unread,
Apr 9, 2007, 1:34:17 PM4/9/07
to
Hi,
Can anyone tell me how to embed a powerpoint window inside a MFC
window/dialog. ?
It would be great is someone posts some code here.

Thanks,
Ajay

Tom Serface

unread,
Apr 9, 2007, 2:40:46 PM4/9/07
to
http://support.microsoft.com/kb/222960/en-us?spid=2522&sid=72

Tom

"Roland" <ajay.s...@gmail.com> wrote in message
news:1176125657....@p77g2000hsh.googlegroups.com...

AliR (VC++ MVP)

unread,
Apr 9, 2007, 3:12:05 PM4/9/07
to
Hi Tom,

On his Friday post he said he didn't like that link. :)

AliR.
"Tom Serface" <tom.n...@camaswood.com> wrote in message
news:3050FDE6-5544-434B...@microsoft.com...

Tom Serface

unread,
Apr 9, 2007, 3:20:23 PM4/9/07
to
OOps, sorry, I missed that. I thought this was the first question (didn't
see any Re: in front of it. Is OP asking the same question in muliple
posts? If so, apologies. I was just in automatic mode.

Tom

"AliR (VC++ MVP)" <Al...@online.nospam> wrote in message
news:%LsSh.2466$zC....@newssvr22.news.prodigy.net...

Ajay Kalra

unread,
Apr 9, 2007, 3:48:07 PM4/9/07
to
> On his Friday post he said he didn't like that link. :)
>

That was Friday. Easter is now gone. Link is now very useful.

---
Ajay


AliR (VC++ MVP)

unread,
Apr 9, 2007, 3:46:00 PM4/9/07
to
No need to apologies, you're good. I just being funny. Yeah he asked this
on Friday. I gave him two links, one was the same one that you just told
him about. But he didn't like my answer. Said something about not wanting
to "Run", but wanted to embed. :)

So I was just trying to be funny.

AliR.

"Tom Serface" <tom.n...@camaswood.com> wrote in message

news:BDC80F9E-23C4-47C5...@microsoft.com...

AliR (VC++ MVP)

unread,
Apr 9, 2007, 3:46:24 PM4/9/07
to
LOL

"Ajay Kalra" <ajay...@yahoo.com> wrote in message
news:1176133687....@e65g2000hsc.googlegroups.com...

AliR (VC++ MVP)

unread,
Apr 9, 2007, 5:22:04 PM4/9/07
to
You know what just popped into my head. Maybe he wants to extract each
frame out of the file, and run the presentation himself.

AliR.

"AliR (VC++ MVP)" <Al...@online.nospam> wrote in message

news:cgtSh.2468$zC....@newssvr22.news.prodigy.net...

Tom Serface

unread,
Apr 9, 2007, 5:57:40 PM4/9/07
to
In that case maybe OP needs something like:

http://support.microsoft.com/kb/237554

To get started :o)

Tom

"AliR (VC++ MVP)" <Al...@online.nospam> wrote in message

news:TFuSh.2039$Q23...@newssvr17.news.prodigy.net...

Roland

unread,
Apr 10, 2007, 5:02:27 AM4/10/07
to
Hi Tom and Ali,
I already went through these articles and created demo's. This example
doesn't fit to my need as I want to show slideshow inside a dilalog or
inside my frame.

Please follow this link where slideshow has been shown inside a frame
control.

http://skp.mvps.org/vb/pptvbwnd.htm

But this thing is done in VB, I want to immitate it in MFC for a
dialog or a win32 window. I don't want to open PowerPoint in another
window, I want to embed activex control ( if it is there ?) inside a
dialog which is created by my application. My dialog should act as a
host window for slideshow.

I hope its pretty much clear to you guys.

Thanks,
Ajay

On Apr 9, 10:57 pm, "Tom Serface" <tom.nos...@camaswood.com> wrote:
> In that case maybe OP needs something like:
>
> http://support.microsoft.com/kb/237554
>
> To get started :o)
>
> Tom
>

> "AliR (VC++ MVP)" <A...@online.nospam> wrote in messagenews:TFuSh.2039$Q23...@newssvr17.news.prodigy.net...


>
>
>
> > You know what just popped into my head. Maybe he wants to extract each
> > frame out of the file, and run the presentation himself.
>
> > AliR.
>

> > "AliR (VC++ MVP)" <A...@online.nospam> wrote in message
> >news:cgtSh.2468$zC....@newssvr22.news.prodigy.net...
> >> LOL
>
> >> "AjayKalra" <ajayka...@yahoo.com> wrote in message


> >>news:1176133687....@e65g2000hsc.googlegroups.com...
> >>>> On his Friday post he said he didn't like that link. :)
>
> >>> That was Friday. Easter is now gone. Link is now very useful.
>
> >>> ---

> >>>Ajay- Hide quoted text -
>
> - Show quoted text -


Tom Serface

unread,
Apr 10, 2007, 1:57:08 PM4/10/07
to
OK, I've never tried to do this, but perhaps this will work for you (I'm
hoping Ali didn't already post this :o) It looks to me from the VB code
like it's just changing the PowerPoint's parent window to be that of the
form. This article talks about how to get that window handle.

http://support.microsoft.com/kb/261997

Tom

"Roland" <ajay.s...@gmail.com> wrote in message

news:1176181347.7...@b75g2000hsg.googlegroups.com...

AliR (VC++ MVP)

unread,
Apr 10, 2007, 2:47:04 PM4/10/07
to
Sounds good to me.

AliR.

"Tom Serface" <tom.n...@camaswood.com> wrote in message

news:CF5D72B5-D021-4FB6...@microsoft.com...

Tom Serface

unread,
Apr 10, 2007, 9:52:37 PM4/10/07
to
Just wanted to make sure. All these links kind of look alike after a while.

Tom

"AliR (VC++ MVP)" <Al...@online.nospam> wrote in message

news:AuNSh.2129$Q23....@newssvr17.news.prodigy.net...

Roland

unread,
Apr 11, 2007, 11:41:05 AM4/11/07
to
But not very much helpful to me. I had already worked on this thing,
Setting parent didn't work out. I guess we need to something extra to
accomplish it.

Thanks,
Ajay

On Apr 10, 7:47 pm, "AliR \(VC++ MVP\)" <A...@online.nospam> wrote:
> Sounds good to me.
>
> AliR.
>

> "Tom Serface" <tom.nos...@camaswood.com> wrote in message


>
> news:CF5D72B5-D021-4FB6...@microsoft.com...
>
>
>
> > OK, I've never tried to do this, but perhaps this will work for you (I'm
> > hoping Ali didn't already post this :o) It looks to me from the VB code
> > like it's just changing the PowerPoint's parent window to be that of the
> > form. This article talks about how to get that window handle.
>
> >http://support.microsoft.com/kb/261997
>
> > Tom
>

> > "Roland" <ajay.sonaw...@gmail.com> wrote in message

> >>> - Show quoted text -- Hide quoted text -

AliR (VC++ MVP)

unread,
Apr 11, 2007, 2:44:06 PM4/11/07
to
Actually that's the one I posted in the ealier thread. The ones that you
posted looked like this one. :)

AliR.

"Tom Serface" <tom.n...@camaswood.com> wrote in message

news:AC36284F-DE39-42DF...@microsoft.com...

AliR (VC++ MVP)

unread,
Apr 11, 2007, 7:35:08 PM4/11/07
to
I have been trying to put together an example for you, but the problem that
I have run into so far is the fact that the persentation is fullscreen, and
I can't figure out a way to change that setting.

AliR.

"Roland" <ajay.s...@gmail.com> wrote in message

news:1176291665.4...@n76g2000hsh.googlegroups.com...

AliR (VC++ MVP)

unread,
Apr 11, 2007, 8:22:36 PM4/11/07
to
Here is a sample.

http://www.learnstar.com/AliR/PowerPointSample.zip

The only problem right now is that the presentation window flashes on the
screen for a split second as a full screen window. I am working on that
part, but this should be a good start.
Run the sample exe and press the "Push me" button and you will see a two
page presentation in the middle of the dialog.
The example was written using VS 2003.

AliR.

"AliR (VC++ MVP)" <Al...@online.nospam> wrote in message

news:MLaTh.7862$u03....@newssvr21.news.prodigy.net...

Tom Serface

unread,
Apr 11, 2007, 9:07:57 PM4/11/07
to
Good stuff Ali.

Tom

"AliR (VC++ MVP)" <Al...@online.nospam> wrote in message

news:gsbTh.4867$5e2....@newssvr11.news.prodigy.net...

AliR (VC++ MVP)

unread,
Apr 11, 2007, 9:35:44 PM4/11/07
to
Thanks Tom. I just can't figure out how to keep the presentation from
showing fullscreen for a second. If you run the sample and press the
button, you will see it flash for a second.

I have been wondering if I can have it start offscreen first.

AliR.


"Tom Serface" <tom.n...@camaswood.com> wrote in message

news:9179735C-9D63-4AB3...@microsoft.com...

Tom Serface

unread,
Apr 11, 2007, 10:20:04 PM4/11/07
to
I tried a few ideas too, but I couldn't figure out how to hide the window
before starting it up. Maybe you could set the size to something really
small so the effect would be less?

Tom

"AliR (VC++ MVP)" <Al...@online.nospam> wrote in message

news:QwcTh.4887$5e2...@newssvr11.news.prodigy.net...

Roland

unread,
Apr 12, 2007, 2:05:37 PM4/12/07
to
Ali,
Fantastic !!!

I was only missing SetWindowPos function call. Seems my all problems
are solved. I also struggling with how to hide presentation form ,
still no success.

Thanks,
Ajay

On Apr 12, 2:35 am, "AliR \(VC++ MVP\)" <A...@online.nospam> wrote:
> Thanks Tom. I just can't figure out how to keep the presentation from
> showing fullscreen for a second. If you run the sample and press the
> button, you will see it flash for a second.
>
> I have been wondering if I can have it start offscreen first.
>
> AliR.
>

> "Tom Serface" <tom.nos...@camaswood.com> wrote in message
>

> news:9179735C-9D63-4AB3...@microsoft.com...
>
>
>
> > Good stuff Ali.
>
> > Tom
>

> > "AliR (VC++ MVP)" <A...@online.nospam> wrote in message

> >news:gsbTh.4867$5e2....@newssvr11.news.prodigy.net...
> >> Here is a sample.
>
> >>http://www.learnstar.com/AliR/PowerPointSample.zip
>
> >> The only problem right now is that the presentation window flashes on the
> >> screen for a split second as a full screen window. I am working on that
> >> part, but this should be a good start.
> >> Run the sample exe and press the "Push me" button and you will see a two
> >> page presentation in the middle of the dialog.
> >> The example was written using VS 2003.
>
> >> AliR.
>

> >> "AliR (VC++ MVP)" <A...@online.nospam> wrote in message

> >>news:MLaTh.7862$u03....@newssvr21.news.prodigy.net...
> >>>I have been trying to put together an example for you, but the problem
> >>>that I have run into so far is the fact that the persentation is
> >>>fullscreen, and I can't figure out a way to change that setting.
>
> >>> AliR.
>

Roland

unread,
Apr 12, 2007, 2:41:50 PM4/12/07
to
Ali
one thing more, In your example, you created you own slides first and
then run slide show. In my example, I am opening existing presentation
file and then run slide show. What happens in my my case, when I run
slideshow, ppt file is also opened in powerpoint window in background,
In your case it doesn't happen because you are creating slides on the
fly.
My question is how to hide powerpoint application running in
background that shows ppt file in design mode.
Still not success with full screen presentation form that appears on
screen for some time.

Waiting for your reply.

Thanks,
Ajay

AliR (VC++ MVP)

unread,
Apr 12, 2007, 3:15:35 PM4/12/07
to
I was hoping that app.set_Visible(FALSE) would do the trick, but it pops up
a message box saying that you can't hide the application window! And
app.get_HWND() doesn't work either.

Anyway, seems like you will have to do it the same way as the persentation
window, using FindWindow.

I have PowerPoint 2003 on my system, I am sure the class name will be
different for other versions:

CWnd *pWnd = FindWindow("PP11FrameClass",NULL);
if (pWnd)
{
pWnd->ShowWindow(SW_HIDE);
}

According to this link http://support.microsoft.com/kb/261997 the old one
is called PP9FrameClass. I guess you could put that in a loop.

All of this would make me a little nervous, what if the user has power point
open?

Here is another approach. You can set the title to a GUID that you generate
using app.put_Caption(....);
Then use EnumWindows to find the exact window, FindWindow wouldn't be
reliable because the title will probably be
"GUID - Persentation name".

AliR.


"Roland" <ajay.s...@gmail.com> wrote in message

news:1176388909.9...@l77g2000hsb.googlegroups.com...

AliR (VC++ MVP)

unread,
Apr 12, 2007, 3:16:48 PM4/12/07
to
You should have been a little more specific as to where you problem was.

I basically copied and pasted the code out of the links that Tom and I
posted a few days ago and changed 2 lines total to get it to work.

AliR.


"Roland" <ajay.s...@gmail.com> wrote in message

news:1176386737.2...@p77g2000hsh.googlegroups.com...

AliR (VC++ MVP)

unread,
Apr 12, 2007, 3:17:51 PM4/12/07
to
I tried that, but the only time that I could set the width or the height was
after the presentation was already up. :(

AliR.

"Tom Serface" <tom.n...@camaswood.com> wrote in message

news:eIJzveIf...@TK2MSFTNGP06.phx.gbl...

Tom Serface

unread,
Apr 12, 2007, 3:44:41 PM4/12/07
to
Yeah, I went back and tried it, and some of the other suggestions here and I
still can't get it to work either. I hate mysteries.

Tom

"AliR (VC++ MVP)" <Al...@online.nospam> wrote in message

news:z4sTh.16275$Um6....@newssvr12.news.prodigy.net...

AnOldGreyMan

unread,
Apr 12, 2007, 5:14:01 PM4/12/07
to
Hi
Please forgive me if I'm missing the point, I do that a lot these days.
I too have been looking at running poerpoint in a window.
I have looked at PPTVb and it works well until I tried to open a link to
another slideshow and it came full screen.
I then found that PPt setup allows you to open it in a browser frame but it
came with full functionality and I don't want users to edit the slides.
I've been working on embedding PPT in a webbrowser control (VB6) and that is
fine but when I link to a new show I loose the hyperlinks on the second slide
unless I scroll down and back up, then it is fine.
I cannot. however create the scroll event programatically.
I've tried windows.document.scrollto(x,y) but only get error messages, it
would seem only to work for a webdocument not ppt.

I don't know ifany of this help move the plot along.
Best wishes

AliR (VC++ MVP)

unread,
Apr 12, 2007, 7:00:34 PM4/12/07
to
Also make sure you don't have any calls to app.set_Visible(TRUE);

AliR.


"Roland" <ajay.s...@gmail.com> wrote in message

news:1176388909.9...@l77g2000hsb.googlegroups.com...

Roland

unread,
Apr 16, 2007, 1:05:40 PM4/16/07
to
Ali,
Do you know how to advance slide manually ? Means my application will
have a button ( Next button) to advance slide maually.

Thanks,
Ajay

AliR (VC++ MVP)

unread,
Apr 16, 2007, 3:40:10 PM4/16/07
to
CSlideShowView::GotoSlide(...) is the function you will have to call.

AliR.

"Roland" <ajay.s...@gmail.com> wrote in message

news:1176728740.8...@p77g2000hsh.googlegroups.com...

AliR (VC++ MVP)

unread,
Apr 16, 2007, 3:48:58 PM4/16/07
to
I fogot to mention that you will have to change the advance mode from 2 to 1

sss.put_AdvanceMode(1); // Use manual advance.

I changed the ssw variable to be a member of my class

CSlideShowWindow *m_ssw;

Then in the method where I start the presentation I used that variable to
start the presentation

sss.put_AdvanceMode(1);

m_ssw = new CSlideShowWindow(sss.Run);

Then in a button handler I put the following code.

void CPowerPointSampleDlg::OnBnClickedButton2()

{

CSlideShowView View(m_ssw->get_View());

View.GotoSlide(View.get_CurrentShowPosition()+1,0);

}

Don't forget to delete m_ssw when you are done with it.
You will also have to check and make sure there is a slide to advance to
before calling GotoSlide.

AliR.

"Roland" <ajay.s...@gmail.com> wrote in message

news:1176728740.8...@p77g2000hsh.googlegroups.com...

Roland

unread,
Apr 23, 2007, 9:25:06 AM4/23/07
to
Hi Ali,

Could you please tell me how to detect "End of slide show" , I have
used Event sinking mechanism to get events of slideshow such as
SlideShowEnd
SlideShowNextSlide etc.

SlideShowEnd fires after you click on "End of slide show" black slide.
I want to get the event before next slide is "End of slide show"
I used SlideShowNextSlide to capture this event but it doesn't come up
for last slide.

Any suggestiions ?


Thanks,
Ajay


On Apr 16, 8:48 pm, "AliR \(VC++ MVP\)" <A...@online.nospam> wrote:
> I fogot to mention that you will have to change the advance mode from 2 to 1
>
> sss.put_AdvanceMode(1); // Use manual advance.
>
> I changed the ssw variable to be a member of my class
>
> CSlideShowWindow *m_ssw;
>
> Then in the method where I start the presentation I used that variable to
> start the presentation
>
> sss.put_AdvanceMode(1);
>
> m_ssw = new CSlideShowWindow(sss.Run);
>
> Then in a button handler I put the following code.
>
> void CPowerPointSampleDlg::OnBnClickedButton2()
>
> {
>
> CSlideShowView View(m_ssw->get_View());
>
> View.GotoSlide(View.get_CurrentShowPosition()+1,0);
>
> }
>
> Don't forget to delete m_ssw when you are done with it.
> You will also have to check and make sure there is a slide to advance to
> before calling GotoSlide.
>
> AliR.
>

> "Roland" <ajay.sonaw...@gmail.com> wrote in message


>
> news:1176728740.8...@p77g2000hsh.googlegroups.com...
>
>
>
> > Ali,
> > Do you know how to advance slide manually ? Means my application will
> > have a button ( Next button) to advance slide maually.
>
> > Thanks,

0 new messages