none
VidControl Control steals focus RRS feed

  • Question

  • I've written a really simple DVD player in VB2008 express.

    I have a ms tv video control (MSVidCtl) working nicely with a few start/stop buttons.

    But, if I click the video control area at any point it won't allow focus back to any other button.

    I can't see a property to prevent focus...

    Can anyone tell me how to fix this?

    thanks
    Z
    Thursday, September 4, 2008 11:15 PM

Answers

  •  I went at this for 4 hours, google and forums: no luck other than this glimpse: http://forums.msdn.microsoft.com/en-US/csharpgeneral/thread/b5ae3623-527a-419d-87ae-7b44249e4282/

     Got 3 hours sleep and solved it within 20 minutes: ring any bells with anyone? 

     I put the call/creation on a different thread; which I thought was a difficult thing to do but is actually easy.

     change this:

    Option Explicit On 
     
       
     
    Dim WithEvents oVidWebDVD As MSVidCtlLib.MSVidWebDVD  
     
    Dim oVidWebAdm As MSVidCtlLib.MSVidWebDVDAdm  
     
       
     
    Sub BuildGraph()  
     
    oVideoControl.View("DVD:")  
     
    oVideoControl.Build()  
     
    oVidWebDVD = oVideoControl.InputActive  
     
    oVidWebAdm = oVidWebDVD.DVDAdm  
     
    oVideoControl.Run()  
     
    End Sub 
     
       
     
    Public Sub New()  
     
    InitializeComponent()  
     
    BuildGraph()  
     
    End Sub 
     

    to this

    Option Explicit On 
     
    Imports System.Threading  
     
       
     
    Dim WithEvents oVidWebDVD As MSVidCtlLib.MSVidWebDVD  
     
    Dim oVidWebAdm As MSVidCtlLib.MSVidWebDVDAdm  
     
       
     
    Sub BuildGraph()  
     
    oVideoControl.View("DVD:")  
     
    oVideoControl.Build()  
     
    oVidWebDVD = oVideoControl.InputActive  
     
    oVidWebAdm = oVidWebDVD.DVDAdm  
     
    oVideoControl.Run()  
     
    End Sub 
     
       
     
    Public Sub acxBegin()  
     
    BuildGraph()  
     
    End Sub 
     
       
     
       
     
    Public Sub New()  
     
    InitializeComponent()  
     
    Dim acxThread As Thread  
     
    acxThread = New Thread(AddressOf Me.acxBegin)  
     
    acxThread.Start()  
     
    End Sub 
     
    • Marked as answer by zaurska Friday, September 5, 2008 8:43 AM
    Friday, September 5, 2008 8:42 AM