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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Windows, wndproc, mouse

Windows, wndproc, mouse

Scheduled Pinned Locked Moved C / C++ / MFC
help
5 Posts 3 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.
  • realJSOPR Offline
    realJSOPR Offline
    realJSOP
    wrote on last edited by
    #1

    I have a CView object that is part of a MDI app. This view is created whenever the user wants to capture a frame from a live video source (using DirectShow and WDM). I need functionality that allows the user to right click in this view and have a popup menu come up. If I don't resize the view, the entire client rect is used by the live video. When I maximize the view, I get a black border around the live video. This black border is expected since the video window must be a certain proportional size. Problem: If I click in the black border area, I get my popup menu. If I click on the video "window", the mouse clicks get eaten. I need the mouse clicks to be handled when they are performed over the video (as well as when they are performed over the black border section). If you need to ask questions, I will answer them to the best of my ability. "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

    R C 2 Replies Last reply
    0
    • realJSOPR realJSOP

      I have a CView object that is part of a MDI app. This view is created whenever the user wants to capture a frame from a live video source (using DirectShow and WDM). I need functionality that allows the user to right click in this view and have a popup menu come up. If I don't resize the view, the entire client rect is used by the live video. When I maximize the view, I get a black border around the live video. This black border is expected since the video window must be a certain proportional size. Problem: If I click in the black border area, I get my popup menu. If I click on the video "window", the mouse clicks get eaten. I need the mouse clicks to be handled when they are performed over the video (as well as when they are performed over the black border section). If you need to ask questions, I will answer them to the best of my ability. "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

      R Offline
      R Offline
      Remi Morin
      wrote on last edited by
      #2

      Inside you'r CView you're using a kindof a control? a CWnd derived class. This CWnd derived class Trap the mouse capture so, the event is catch by this and not by you'r cView. So you must do somthing Inside this CWnd control to handle this event and from there call you'r function anything DisplayPopupMenu(void) { } this will be call from you'r CView class AND from you'r control who diplay the animation. hope this will help Remi Morin Rmorin@Operamail.com Remi.Morin@Lyrtech.com

      1 Reply Last reply
      0
      • realJSOPR realJSOP

        I have a CView object that is part of a MDI app. This view is created whenever the user wants to capture a frame from a live video source (using DirectShow and WDM). I need functionality that allows the user to right click in this view and have a popup menu come up. If I don't resize the view, the entire client rect is used by the live video. When I maximize the view, I get a black border around the live video. This black border is expected since the video window must be a certain proportional size. Problem: If I click in the black border area, I get my popup menu. If I click on the video "window", the mouse clicks get eaten. I need the mouse clicks to be handled when they are performed over the video (as well as when they are performed over the black border section). If you need to ask questions, I will answer them to the best of my ability. "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        I'd suggest using SetCapture when the mouse is over the video feed, so that the mouse message is caught by your main window. I'm presuming the video is coming in through a control you cannot edit to catch the message directly. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001

        realJSOPR 2 Replies Last reply
        0
        • C Christian Graus

          I'd suggest using SetCapture when the mouse is over the video feed, so that the mouse message is caught by your main window. I'm presuming the video is coming in through a control you cannot edit to catch the message directly. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001

          realJSOPR Offline
          realJSOPR Offline
          realJSOP
          wrote on last edited by
          #4

          DirectShow is a pain in the ass. Here's what I'm doing: When the view is instantiated (due to the user clicking a menu item to view a video window), the view sends its hwnd to another class which controls access to a DLL. The DLL calls SetWindowLong(theCviewHwnd, GWL_WNDPROC, callbackFunc) so that the mouse clicks can be passed back to the original window. The results are as I stated before - if I right-click in the black border area (not covered by the live video stream window), the view responds as expected with a popup menu being displayed, but if I click on the rectangle containing the video, the mouse click is ignored. "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

          1 Reply Last reply
          0
          • C Christian Graus

            I'd suggest using SetCapture when the mouse is over the video feed, so that the mouse message is caught by your main window. I'm presuming the video is coming in through a control you cannot edit to catch the message directly. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001

            realJSOPR Offline
            realJSOPR Offline
            realJSOP
            wrote on last edited by
            #5

            I just found out what I was doing wrong (or more accurately, not doing at all). It's got to do with an interface in the COM object. I wasn't calling a function that directs messages to the owner window (because the documentation implied that it only forwarded video events to the parent window, and not regular windows commands). Sometimes, MSDN help sucks. "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

            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