Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6778225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:14:31+00:00 2026-05-26T16:14:31+00:00

I am using vlc to capture a video and audio stream and display it

  • 0

I am using vlc to capture a video and audio stream and display it in a picture box. The new libvlc api no longer supports the double click/fullscreen in windows and I need to have that functionality. I don’t have a problem creating a new form, adding a picture box to it and showing the video in that, but I do have a problem capturing the double click event in the vlc window in order to tell the app to make the video feed fullscreen. I found out that I need to use a hook. I have the hook installed and all of that. My only problem is, I only want to handle the message if it is a click in one of my pictureboxes. So, from my callback method, here is what I need:

private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam)
    {
        if (nCode >= 0 &&  MouseMessages.WM_LBUTTONDOWN == (MouseMessages)wParam)
        {
            //Here I need to grab the Handle of the control that the mouse was clicked in.
            //Now I need to cast the Control.FromHandle() as PictureBox.
            // then if(control != null)
            // send the event to the form via. form.on_double_click or whatever.


        }
        return CallNextHookEx(_hookID, nCode, wParam, lParam);
    }

Any ideas?

Ubdate:

Here is what I’ve got now, look good?

private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam)
    {
        if (nCode >= 0 &&  MouseMessages.WM_LBUTTONDOWN == (MouseMessages)wParam)
        {
            MOUSEHOOKSTRUCT msg = (MOUSEHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MOUSEHOOKSTRUCT));

            PictureBox control = Control.FromHandle(msg.hwnd) as PictureBox;

            if (control != null)
            {
                PreviewForm.pbox_MouseDoubleClick(control, new MouseEventArgs(MouseButtons.Left, 2, msg.pt.x, msg.pt.y, 0));
            }                
        }
        return CallNextHookEx(_hookID, nCode, wParam, lParam);
    }

Update

Another little gotcha for those coming in from Google. In Windows 7, If you attach your debugger to the callback, it will appear to be broken. There is a timeout value on hook responses, if that timeout ever expires, your hook will never fire again for the life of the hook. From my reading, it appears that this is a Windows 7 issue while it works on Windows Vista and less. The break point in your debugger will most certainly force this timeout to expire and as a result, your callback will only be called once. However, it will work fine without the break point.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:14:31+00:00Added an answer on May 26, 2026 at 4:14 pm

    Your lParam is a pointer to a MOUSEHOOKSTRUCT which will contain the window handle.

    You can use the definition a Pinvoke.net and marshal lParam to that type.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a live-stream by using vlc on rtp, (preferably) rtsp or
I'm working on a simple video player in Python and PyGTK, using VLC as
Hi I'm trying using vlc to broadcast UDP stream within a LAN, Making it
How can I convert a video from mp4 to webm using VLC, if possible?
I'm experimenting with some video content delivery using VLC and Apache Reverse Proxy. Since
I have implemented a raw rtp stream. I want to play it using VLC
I need to run a webserver that will stream video using rtsp. I am
I want to stream the video from android phone camera to VLC media player
I'm using AVAssetWriter with a AVAssetWriterInputPixelBufferAdaptor to capture video from an AVCaptureSession. I'm writing
I would like to display a live video stream in a web browser. (Compatibility

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.