|
how can i get list of connected cameras with system? by using capGetDriverDescription() i just get the driver name which can be common for many capturing device
|
|
|
|
|
This sample[^] talks about device, rather than driver names?
|
|
|
|
|
reference u provide gives information of driver not device
i need device name (i need all cammera names which are connceted with system)
how it will possible?
|
|
|
|
|
Hi everyone,
Could anyone please tell me how to use message queue using ace framework....A simple message queue,(without any socket programming)....
Thanks in advance
I am a learner Always
|
|
|
|
|
|
Hi all,
In my application I want to handle the insert(plug in) and removal(plug out) of the devices so that i have to re enumerate and show the user present devices connected to the system.But my application is limited to re enumeration of HID devices only, so i want to handle the device change only for HID devices.
I handled the WindProc() in which I used if(message == WM_DEVICECHANGE) but I am getting in to this loop for every device change but how can I check whether device change is for HID devices or not.
Please suggest a right approach for this.
Thanks in advance.
|
|
|
|
|
|
Hi. I am sure you can help me.
I want to write a program that just detect that a device has been changed. And in my program it is not concerned which device is changed. I have been trying for 15days but not able to handle windproc function. I am not getting any clue how to handle this function. Please send me a sample code. Please please please. I am getting really sick of this. Send me at john.alex.programmer@gmail.com. Please help me. PLZ PLZ PLZ PLZ PLZ.
|
|
|
|
|
Hi. I am sure you can help me.
I want to write a program that just detect that a device has been changed. And in my program it is not concerned which device is changed. I have been trying for 15days but not able to handle windproc function. I am not getting any clue how to handle this function. Please send me a sample code. Please please please. I am getting really sick of this. Send me at john.alex.programmer@gmail.com. Please help me.
|
|
|
|
|
Hi Alex,
Did u try with the WindowProc(...) and if(message == WM_DEVICECHANGE ) inside it? This will be triggered if there is any change in the device connected to the system (Like plugging and Unplugging)
|
|
|
|
|
I have tried. But you know the main problem with me is that i dont know how to write windproc function and what are the parameters. I just want a running sample of windproc function. Then I will definitely do. Thanx.
|
|
|
|
|
LRESULT ClassName::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
if(message == WM_DEVICECHANGE )
{
}
return CDialog::WindowProc(message, wParam, lParam);
}
Note : In the first line when i say ClassName it is your respective class name.
|
|
|
|
|
#include <windows.h>
#include <dbt.h>
#include <strsafe.h>
#include<iostream.h>
#pragma comment(lib, "user32.lib")
void Main_OnDeviceChange (HWND hwnd, WPARAM wParam, LPARAM lParam);
char FirstDriveFromMask (ULONG unitmask); //prototype
/*------------------------------------------------------------------
Main_OnDeviceChange (hwnd, wParam, lParam)
Description
Handles WM_DEVICECHANGE messages sent to the application's
top-level window.
--------------------------------------------------------------------*/
HWND hwnd;
WPARAM wParam;
LPARAM lParam;
void Main_OnDeviceChange (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
PDEV_BROADCAST_HDR lpdb = (PDEV_BROADCAST_HDR)lParam;
char szMsg[80];
switch(wParam)
{
case DBT_DEVICEARRIVAL:
// Check whether a CD or DVD was inserted into a drive.
if (lpdb -> dbch_devicetype == DBT_DEVTYP_VOLUME)
{
PDEV_BROADCAST_VOLUME lpdbv = (PDEV_BROADCAST_VOLUME)lpdb;
if (lpdbv -> dbcv_flags & DBTF_MEDIA)
{
StringCchPrintf (szMsg, 80, "Drive %c: Media has arrived.\n",
FirstDriveFromMask(lpdbv ->dbcv_unitmask));
MessageBox (hwnd, szMsg, "WM_DEVICECHANGE", MB_OK);
cout<<"Hi";
}
}
break;
case DBT_DEVICEREMOVECOMPLETE:
// Check whether a CD or DVD was removed from a drive.
if (lpdb -> dbch_devicetype == DBT_DEVTYP_VOLUME)
{
PDEV_BROADCAST_VOLUME lpdbv = (PDEV_BROADCAST_VOLUME)lpdb;
if (lpdbv -> dbcv_flags & DBTF_MEDIA)
{
StringCchPrintf (szMsg, 80, "Drive %c: Media was removed.\n",
FirstDriveFromMask(lpdbv ->dbcv_unitmask));
MessageBox (hwnd, szMsg, "WM_DEVICECHANGE", MB_OK);
cout<<"Hi";
}
}
break;
default:
/*
Process other WM_DEVICECHANGE notifications for other
devices or reasons.
*/
;
}
}
/*------------------------------------------------------------------
FirstDriveFromMask (unitmask)
Description
Finds the first valid drive letter from a mask of drive letters.
The mask must be in the format bit 0 = A, bit 1 = B, bit 2 = C,
etc. A valid drive letter is defined when the corresponding bit
is set to 1.
Returns the first drive letter that was found.
--------------------------------------------------------------------*/
char FirstDriveFromMask (ULONG unitmask)
{
char i;
for (i = 0; i < 26; ++i)
{
if (unitmask & 0x1)
break;
unitmask = unitmask >> 1;
}
return (i + 'A');
}
int main()
{
while(1)
{
Main_OnDeviceChange (hwnd,wParam,lParam);
}
return 0;
}
I found this code on msdn. Where to write it in Vc++. On win32 application or on simple c++ file. Neither main() function is here no win_main function is here. Please help.
|
|
|
|
|
Hi
I am using a multidocument application.
CMultiDocTemplate* pDocTemplate_Digi;
pDocTemplate_Digi = new CMultiDocTemplate(
IDR_DIGITAL,
RUNTIME_CLASS(CDDRUDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CSuperGrid1View));
my view CSuperGrid1View is inherited from CFormview.
I want to disable the scroll bars that is coming default in my view.
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs]
cs.style &= ~WS_EX_RIGHTSCROLLBAR;
cs.style &= ~WS_EX_LEFTSCROLLBAR ;
if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
I did the same in CSuperGrid1View::PreCreateWindow(..)
But it is not disabling.Can anybody help me please.
Regards
Deepu
|
|
|
|
|
A form view derived class will automatically show its scroll bars if the client area assigned to it is smaller than the dialog resource used to create the form with. This is so that the controls can be scrolled into view.
To remove the scroll bars you need to handle the WM_SIZE message for your form and call SetScaleToFitSize(cx, cy) (function name from memory with no docs available, may not be precise) function which is part of CScrollView, a base class of CFormView. You may also need to resize/reposition controls on your form so make full use of the available space.
If you vote me down, my score will only get lower
|
|
|
|
|
Hi all,
how can i check the dialog is already open or not just before calling DoModal().
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
"_$h@nky_" wrote: how can i check the dialog is already open or not just before calling DoModal().
If you already have a handle to the window that you are expecting to be open then use functions
1. IsWindowVisible
2. IsWindow - To check validity of window handle
|
|
|
|
|
I m alrady try this its gives error of Debug Assertion Failed.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
"_$h@nky_" wrote: I m alrady try this its gives error of Debug Assertion Failed.
Where does it assert?
|
|
|
|
|
After clicked on Retry button of debug assertion failed dialog box, its focused on afxwin2.inl
on this line.
_AFXWIN_INLINE BOOL CWnd::IsWindowVisible() const
{ ASSERT(::IsWindow(m_hWnd)); return ::IsWindowVisible(m_hWnd); }
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
"_$h@nky_" wrote: _AFXWIN_INLINE BOOL CWnd::IsWindowVisible() const
{ ASSERT(::IsWindow(m_hWnd)); return ::IsWindowVisible(m_hWnd); }
Call IsWindow before IsWindowVisible since the check for visibility can only be done on a valid window handle.
Should be something like
if( !::IsWindow( m_Dlg.GetSafeHwnd() ))
{
m_Dlg.DoModal();
}
else if( !::IsWindowVisible( m_Dlg.GetSafeHwnd() ))
{
m_Dlg.ShowWindow(SW_SHOW);
}
|
|
|
|
|
Its open dialog box again and again i want if dialog box is already open its not open again only show tha previous one.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
"_$h@nky_" wrote: i want if dialog box is already open its not open again only show tha previous one
For this you should create modless dialog and show/hide as required.
Regards,
Sandip.
|
|
|
|
|
If it's a single threaded function, the main thread will be blocked if you've already called "DoModal" (which means the window is visible". So you will not be able to execute the any other functions during this period (sure you can get paint messages and some other notifications to your parent window).
In which case, it's required to check the windows is showing or not?
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
How about using a flag to detect this?
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|