LockWindowUpdate & PowerPoint 2007

J

Jeff

I have used the LockWindowUpdate API call to prevent screen updating while my
code is manipulating a presentation. This works great for PowerPoint 2003,
but doesn't seem to work for PowerPoint 2007. Is there any solution?

In PowerPoint 2007 the screen flashes all over the place while the
presentaion is being modified and it look really bad.
 
J

Jeff

Thank you for the response. Yes. I am getting the HWND using FindWindow and
searching for "PP12FrameClass". This works for Office 10 & Office 11, but
not Office 12.
 
J

Jeff

Thanks for your help, Steve. Unfortuantely, I need to update data in
embedded Excel objects and charts and that requires activating the shapes.
Previous Office versions look really good with LockWindowUpdate. PowerPoint
2007 shows all of the updates.
 
J

Jeff

Shyam, Steve, & Chirag:

Thank you for helping with my problem. I have tested with GetDesktopWindow
and have the same results. I have noticed that LockWindowUpdate(0) returns 0
in the cases where it is not working.

I have also noticed that the call I make to Presentation.NewWindow() seems
to trigger the problem. If I comment out the code where I work with a new
document window, then the screen appears to lock correctly. However, it is
difficult to avoid the NewWindow call in our code. Again, tha same code
works fine in Office 2003.

I assume that Presentation.NewWindow() is internally locking a window for
update in PPT 2007. Any thoughts?

LockWindow(21628820): 1
Presentation.NewWindow();
LockWindow(0): 0 << This is 1 if I don't call NewWindow()
 
C

Chirag

In that case, do a LockWindowUpdate() after a call to NewWindow().

Something like:

LockWindowUpdate(PPTWindow)
.... code ...
LockWindowUpdate(0)
Presentation.NewWindow()
LockWindowUpdate(PPTWindow)
.... more code ...
LockWindowUpdate(0)

It does show the new window to the user before the processing with "more
code" but otherwise should result in a lot less flickering.

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
J

Jeff

Chirag:

I tried that yesterday and it greatly reduced the flickering. It still
flashes, but I think it will be acceptable. I found that I needed to cal
LockWindowUpdate() after NewWindow() and also after DocumentWindow.Close().
Thank you all for your help and ideas.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top