home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 8,928 of 10,840   
   Randy Birch to Ray   
   Re: Help with Network/Web Cam active   
   30 Oct 04 21:59:49   
   
   From: rgb_removethis@mvps.org   
      
   I don't think that's what you want ... the MSDN states that particular   
   message is used to retrieve the status of the capture window -- the   
   CAPSTATUS structure contains information regarding the dimensions of the   
   image, scroll position, and whether overlay or preview of the image is   
   enabled.   
      
   This of course presumes that there is a capture window on-screen.   
      
   As far as the calling syntax, that looks like it should be a simple   
   SendMessage call.  I don't have a camera, but off the top of my head I'd be   
   inclined to start with:   
      
   const WM_CAP_GET_STATUS = whatever value it is   
      
   Private Type POINTAPI   
     x As Long   
     y As Long   
   End Type   
      
   Private Type CAPSTATUS   
      uiImageWidth As Long   
      uiImageHeight As Long   
      fLiveWindow As Long   
      fOverlayWindow As Long   
      fScale As Long   
      ptScroll As POINTAPI   
      fUsingDefaultPalette As Long   
      fAudioHardware As Long   
      fCapFileExists As Long   
      dwCurrentVideoFrame As Long   
      dwCurrentVideoFramesDropped As Long   
      dwCurrentWaveSamples As Long   
      dwCurrentTimeElapsedMS As Long   
      hPalCurrent As Long   
      fCapturingNow As Long   
      dwReturn As Long   
      wNumVideoAllocated As Long   
      UINT wNumAudioAllocated   
   End Type   
      
   Private Declare Function SendMessage Lib "user32" _   
      Alias "SendMessageA" _   
     (ByVal hWnd As Long, _   
      ByVal wMsg As Long, _   
      ByVal wParam As Long, _   
      lParam As Any) As Long   
      
   dim success as long   
   dim cap as CAPSATUS   
      
   success = sendmessage (hwnd, wm_cap_get_status, len(cap), cap)   
      
   if success <> 0 then   
      ? "it worked"   
      ? cap.uiImageWidth   
      ? cap.uiImageHeight   
   end if   
      
   The problem is the hwnd parameter ... no idea what to put there.   
      
   I'm wondering, reading the MSDN, if the WM_CAP_DRIVER_GET_NAME message may   
   not be more appropriate?  Its description is "returns the name of the   
   capture driver connected to the capture window."  This implies to me that if   
   the capture window exists and is connected to a device you get a name, and   
   if it does not exist you get no info.   
      
   There's also WM_CAP_GET_SEQUENCE_SETUP -- "retrieves the current settings of   
   the streaming capture parameters" into a CAPTUREPARAMS structure containing   
   info such as dwMCIStartTime and dwMCIStopTime.   
      
   Problem here again though is in order to use SendMessage you have to direct   
   it to the hwnd of the capture window.  A catch-22.   
      
   I also wonder if this is the path to go down?  After all, a web cam can be   
   in use without a media player (for example) session on screen. It seems to   
   me these messages target the GUI aspect of video, not the use of a web cam.   
      
   I guess you're looking for the equivalent of a "WM_IS_CAMERA_IN_USE"   
   message, which I don't see as being available.   
      
   --   
      
      
   Randy Birch   
   MS MVP Visual Basic   
   http://vbnet.mvps.org/   
      
      
   "Ray"  wrote in message   
   news:UK-dnaM3QcEboRncRVn-jA@adelphia.com...   
   : I'm using VB6, I am a little more then a novice but not much..   
   : and my question is - Is there a way to detect and possibly notify   
   : (me/mycomputer)  if someone is using a Web Cam mainly MSN on my LAN with   
   out   
   : the user knowing it? Even if I have to install software on the user   
   : computer..   
   :   
   : I not sure if this is the right way to go about this   
   :   
   : I can get the WM_CAP_DRIVER_CONNECT to return a True/False but this brings   
   : up a (Video Source window) if False,  I just want the value (T/F)   
   :   
   : I am unable to get the WM_CAP_GET_STATUS to work.   
   :   
   : Any help or sources would be appreciated.   
   :   
   : Thanks..   
   : Ray   
   :   
   :   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca