Active Shape Module

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

Hello All.

I was using Chirag's Active Shape Module and noticed that
on some machines it didn't work. After some investigation
I pinpointed the problem down to the GetWindowRect
function. Apparently the function is not setting values of
the rect that is passed into. I have no doubt that the
module is fine and this problem is really a result of
something else. Has anyone else experienced this? Does
anyone know why this function might not work on only some
machines?

I hope I've characterized this well being a VBA newbie and
all.

Thanks.
e.
 
Hi Eric,

Is GetWindowRect() returning 0 or the bounds are all 0s? What is the class
name of the instance you are trying to set focus on?

- Chirag
 
Hi Chirag.

Here's specifically what's happening. GetWindowRect never
returns 0. That is fine. But it is returning assigning 0
for ChildWR.Left, ChildWR.Top, ChildWR.Right,
ChildWR.Bottom. So the conditional statement:

If (Abs(ShapeRect.Left - ChildWR.Left) <= 1) And _
(Abs(ShapeRect.Top - ChildWR.Top) <= 1) And _
(Abs(ShapeRect.Right - ChildWR.Right) <= 1) And _
Abs(ShapeRect.Bottom - ChildWR.Bottom) <= 1)

is obviously never being met.


Keep in mind this doesn't happen on all machines. On
machines where Active Shape Module works, GetWindowRect
returns actuals values for ChildWR's and eventually the
conditional statement is met (presumably when it finds the
Flash movie) ... and everything then goes on to act
accordingly. The Classname is assigned and checked with
VBA_CONTROL_CLASS (which i did assigned
to "MacromediaFlashPlayerActiveX"). GetWindowRect's values
are really what is different between machines.

And check this out. If I comment out the conditional
statement, then everything works. Except in the case where
I put multiple Flash movies on one slide, then the top-
most ordered Flash movie is always activated.


e.
 
Back
Top