Get handle to slideshow window.

  • Thread starter Thread starter Mike M.
  • Start date Start date
M

Mike M.

PPT2002, Widows 2000.
I wrote some code based upon some previous posts that does what I want it to
but I am not sure why it works. This is much better than it not working and
I am not sure why. I thought I would post the relevant snippet of code to
see if anyone can splain it to me. If I don't know why it works then I can
expect a support call on a Saturday at 4:00 AM. <g>

I open a presentation and then find the handle to it. Periodically I send a
new presentation to the computer and my program opens the new one, finds the
handle and then closes the old one. What I am unclear about is the magic
"screenClass" used in the FindWindow function call. Since I have two slide
shows open can I be assured I will find the second one on the subsequent
FindWindow call? It seems to do that. I am thinking the Windows must be
pushed on to the top of "stack".

pptNewPresentation = pptApplication->Presentations->Open(
presFile.AllocSysString(),
Office::msoTrue, Office::msoFalse, Office::msoFalse );
pptNewPresentation->SlideShowSettings->ShowType =
PowerPoint::ppShowTypeSpeaker;
pptNewPresentation->SlideShowSettings->Run();

// this seems to find it.
pptHwnd = ::FindWindow("screenClass", NULL);
 
This looks for a window with no name (Null). This name, coincidentally, is
the name PowerPoint gives to the running presentation.

B
--
===============
Please spend a few minutes checking out www.pptfaq.com This link will
answer most of our questions, before you think to ask them.

Change org to com to defuse anti-spam, ant-virus, anti-nuisance
misdirection.
 
I searched the "whole" internet for screenClass and found very little about
it. I assumed this was the class PowerPoint gave it's Window but it seems a
little generic. I am afraid some other program may some day use the same
class name and my program won't work. I guess I will cross that bridge when
I come to it.
 
Back
Top