Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Redraw Child Windows in ActiveX Control

Redraw Child Windows in ActiveX Control

Scheduled Pinned Locked Moved C / C++ / MFC
comhelpc++graphicsgame-dev
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dkmr
    wrote on last edited by
    #1

    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.

    B 1 Reply Last reply
    0
    • D dkmr

      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.

      B Offline
      B Offline
      Bogdan Apostol
      wrote on last edited by
      #2

      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.

      D 1 Reply Last reply
      0
      • B Bogdan Apostol

        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.

        D Offline
        D Offline
        dkmr
        wrote on last edited by
        #3

        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

        B 1 Reply Last reply
        0
        • D dkmr

          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

          B Offline
          B Offline
          Bogdan Apostol
          wrote on last edited by
          #4

          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.

          D 1 Reply Last reply
          0
          • B Bogdan Apostol

            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.

            D Offline
            D Offline
            dkmr
            wrote on last edited by
            #5

            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.

            B 1 Reply Last reply
            0
            • D dkmr

              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.

              B Offline
              B Offline
              Bogdan Apostol
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups