Consultor Eletrônico



Kbase 21625: Microsoft Animation ActiveX Control is not transparent
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

FACT(s) (Environment):

Windows 32 Intel
Windows NT 32 Intel/Windows 2000

SYMPTOM(s):

Microsoft Animation ActiveX Control is not transparent

FIX:

When running the MS Animation Control in a Progress window, the background color of the CONTROL-FRAME is white even though the BackStyle property of the OCX is set to Transparent and the color of the CONTROL-FRAME is "?".

In the following code, the border color of the Active Window is retrieved from the registry and then added to the Progress color table.  Afterwards, the background color of the CONTROL-FRAME is set to this new color.

DEFINE VARIABLE cBkColor AS CHARACTER NO-UNDO.
DEFINE VARIABLE i AS INTEGER NO-UNDO.

/* Get the Maximum number of colors in the color table */
i = COLOR-TABLE:NUM-ENTRIES.

/* Retrieve the color of the border of Active Window in the registry
HKEY_CURRENT_USER\Control Panel\Colors
For instance: 192 192 192
*/
LOAD "Control Panel" BASE-KEY "HKEY_CURRENT_USER".
USE "Control Panel".

GET-KEY-VALUE SECTION "Colors"
KEY "ActiveBorder"
VALUE cBkColor.

UNLOAD "Control Panel" .

/* Add new color in the current color table */
COLOR-TABLE:NUM-ENTRIES = i + 1.
COLOR-TABLE:SET-DYNAMIC(i, yes).
COLOR-TABLE:SET-RED-VALUE(i, INTEGER(ENTRY(1,cBkColor," "))).
COLOR-TABLE:SET-GREEN-VALUE(i, INTEGER(ENTRY(2,cBkColor," "))).
COLOR-TABLE:SET-BLUE-VALUE(i, INTEGER(ENTRY(3,cBkColor," "))).

/* Set the background color of the CONTROL-FRAME */
ctrlFrame:BGCOLOR = i.

/* Start the Animation */
chCtrlFrame:Animation:OPEN("FileCopy.avi").
chCtrlFrame:Animation:play().