Redraw Child Windows in ActiveX Control
-
Hello, Here's my problem: I have an ActiveX control which has the functionality of a video player. After integrating it in my MFC dialog, when I play the video, if I drag the dialog out from the screen, or maximize it, or drag some other dialog over it, the ActiveX control doesn't redraw its child windows properly. More exactly, it's about two DirectX child windows which are created for playing the video. One is a DirectX output window and one is the video overlay. Instead redrawing them corectly (video frames playing) I get the area filled with the MFC dialog's background. Setting Clip Siblings to true in the MFC dialog's properties doesn't help much. Indeed, I don't have the area filled with the background but the redraw of the ActiveX windows isn't still made properly (it's a mess .. background mixed with video or something else.. ) I managed to get the handles of the two DirectX windows and tried various solutions starting from calling Invalidate for the entire control to WinAPI calls to RedrawWindow on the handles (and others). Nothing seems to make the video output windows repaint themselves after being covered with something else. I need to mention that I don't have any experience with DirectX or with ActiveX/COM besides using controls. If someone can give me a hint for a solution many many thanks in advance.
-
Hello, Here's my problem: I have an ActiveX control which has the functionality of a video player. After integrating it in my MFC dialog, when I play the video, if I drag the dialog out from the screen, or maximize it, or drag some other dialog over it, the ActiveX control doesn't redraw its child windows properly. More exactly, it's about two DirectX child windows which are created for playing the video. One is a DirectX output window and one is the video overlay. Instead redrawing them corectly (video frames playing) I get the area filled with the MFC dialog's background. Setting Clip Siblings to true in the MFC dialog's properties doesn't help much. Indeed, I don't have the area filled with the background but the redraw of the ActiveX windows isn't still made properly (it's a mess .. background mixed with video or something else.. ) I managed to get the handles of the two DirectX windows and tried various solutions starting from calling Invalidate for the entire control to WinAPI calls to RedrawWindow on the handles (and others). Nothing seems to make the video output windows repaint themselves after being covered with something else. I need to mention that I don't have any experience with DirectX or with ActiveX/COM besides using controls. If someone can give me a hint for a solution many many thanks in advance.
Is the ActiveX control written by you? My first try would be to disable the erase background and paint events in the MFC dialog, and see if the control draws properly... even that your MFC dialog will look horrible. If the problem was that your dialog ruins the video playing, then you can try to set the flag for clip children (not clip siblings). Can you tell us if the ActiveX control is using DirectX overlay for playing video? Regards,
Bornish ESRI Developer Network Compilers demystified - Function pointers in Visual Basic 6.0 Enables the use of function pointers in VB6 and shows how to embed native code in a VB application.
-
Is the ActiveX control written by you? My first try would be to disable the erase background and paint events in the MFC dialog, and see if the control draws properly... even that your MFC dialog will look horrible. If the problem was that your dialog ruins the video playing, then you can try to set the flag for clip children (not clip siblings). Can you tell us if the ActiveX control is using DirectX overlay for playing video? Regards,
Bornish ESRI Developer Network Compilers demystified - Function pointers in Visual Basic 6.0 Enables the use of function pointers in VB6 and shows how to embed native code in a VB application.
No, the ActiveX isn't written by me. I have already tried to disable the WM_ERASEBKGND message for the dialog and the only thing changed is indeed that the dialog looks horrible. The ActiveX control has the same problem. Adding the disabling WM_PAINT makes the dialog fully transparent - and still no proper redraw in the video control. (I've let only the control at this moment on the dialog, which is a modeless one launched from the main application dialog) My mistake, sorry, I wrote the first post in a hurry, the Clip Children was the property I set and doesn't make much difference, not the Clip Siblings. Finally, yes, the control is using DirectX overlay, is the problem there ? Thank you for your interest
-
No, the ActiveX isn't written by me. I have already tried to disable the WM_ERASEBKGND message for the dialog and the only thing changed is indeed that the dialog looks horrible. The ActiveX control has the same problem. Adding the disabling WM_PAINT makes the dialog fully transparent - and still no proper redraw in the video control. (I've let only the control at this moment on the dialog, which is a modeless one launched from the main application dialog) My mistake, sorry, I wrote the first post in a hurry, the Clip Children was the property I set and doesn't make much difference, not the Clip Siblings. Finally, yes, the control is using DirectX overlay, is the problem there ? Thank you for your interest
Have you tried to see if other applications using DirectX overlay have a similar problem? Could be a graphics card / driver / driver settings problem. I could try the ActiveX control if you send me a copy and if it doesn't have some licensing issue. For now, I can't think of a specific reason for your problem. It would be much easier to try it myself. Best wishes,
Bornish ESRI Developer Network Compilers demystified - Function pointers in Visual Basic 6.0 Enables the use of function pointers in VB6 and shows how to embed native code in a VB application.
-
Have you tried to see if other applications using DirectX overlay have a similar problem? Could be a graphics card / driver / driver settings problem. I could try the ActiveX control if you send me a copy and if it doesn't have some licensing issue. For now, I can't think of a specific reason for your problem. It would be much easier to try it myself. Best wishes,
Bornish ESRI Developer Network Compilers demystified - Function pointers in Visual Basic 6.0 Enables the use of function pointers in VB6 and shows how to embed native code in a VB application.
The control is open source, so I don't see any licensing problems. I know almost nothing about COM/ActiveX development like I said in the first post. If I did I would have taken a look myself inside it's code. I'll mail it to you on the address specified in the link in your signature if it is ok (please let me know). As far as I know, I think there are video players that use DirectX overlay. I don't know one exactly but I don't remember seeing any player to "behave" in this way. Again, many thanks for the answer.
-
The control is open source, so I don't see any licensing problems. I know almost nothing about COM/ActiveX development like I said in the first post. If I did I would have taken a look myself inside it's code. I'll mail it to you on the address specified in the link in your signature if it is ok (please let me know). As far as I know, I think there are video players that use DirectX overlay. I don't know one exactly but I don't remember seeing any player to "behave" in this way. Again, many thanks for the answer.
Yes, you can use that email address. If you'd like you can simply send the location where I can find the open-source code for the control. I'll create a sample test project and try to reproduce the behaviour you've been describing. Regards,
Bornish ESRI Developer Network Compilers demystified - Function pointers in Visual Basic 6.0 Enables the use of function pointers in VB6 and shows how to embed native code in a VB application.