Click here to Skip to main content
15,888,454 members
Home / Discussions / C#
   

C#

 
QuestionHow to search data on DataGridView that is being data paging? [modified] Pin
nhatvhm10-Sep-08 1:38
nhatvhm10-Sep-08 1:38 
QuestionThread question ? Pin
Mohammad Dayyan10-Sep-08 1:30
Mohammad Dayyan10-Sep-08 1:30 
AnswerRe: Thread question ? Pin
Nicholas Butler10-Sep-08 1:43
sitebuilderNicholas Butler10-Sep-08 1:43 
AnswerRe: Thread question ? Pin
blackjack215010-Sep-08 3:05
blackjack215010-Sep-08 3:05 
AnswerRe: Thread question ? Pin
Ennis Ray Lynch, Jr.10-Sep-08 3:26
Ennis Ray Lynch, Jr.10-Sep-08 3:26 
Questionabout Device info [modified] Pin
vinay_K10-Sep-08 1:03
vinay_K10-Sep-08 1:03 
QuestionRe: about Device info Pin
Harvey Saayman10-Sep-08 1:40
Harvey Saayman10-Sep-08 1:40 
AnswerRe: about Device info Pin
vinay_K10-Sep-08 1:53
vinay_K10-Sep-08 1:53 
that is system dll, im invoking it...
this is code..




[DllImport("user32.dll", CharSet = CharSet.Auto)]<br />
        public static extern IntPtr RegisterDeviceNotification(IntPtr hRecipient, DEV_BROADCAST_DEVICEINTERFACE NotificationFilter, UInt32 Flags);<br />
<br />
        [DllImport("user32.dll", CharSet = CharSet.Auto)]<br />
        public static extern uint UnregisterDeviceNotification(IntPtr hHandle);<br />
<br />
        [DllImport("setupapi.dll", SetLastError = true)]<br />
        public static extern IntPtr SetupDiGetClassDevs(ref Guid gClass, UInt32 iEnumerator, IntPtr hParent, UInt32 nFlags);



List< string > HWList = new List< string >();

public list< string > getAll()
{
 Guid myGUID = System.Guid.Empty;
                IntPtr hDevInfo = Native.SetupDiGetClassDevs(ref myGUID, 0, IntPtr.Zero, Native.DIGCF_ALLCLASSES | Native.DIGCF_PRESENT);

                if (hDevInfo.ToInt32() == Native.INVALID_HANDLE_VALUE)
                {
                    throw new Exception("Invalid Handle");
                }
                Native.SP_DEVINFO_DATA DeviceInfoData;
                DeviceInfoData = new Native.SP_DEVINFO_DATA();
                DeviceInfoData.cbSize = 28;
                //is devices exist for class
                DeviceInfoData.devInst = 0;
                DeviceInfoData.classGuid = System.Guid.Empty;
                DeviceInfoData.reserved = 0;
                UInt32 i;
                StringBuilder DeviceName = new StringBuilder("");
                DeviceName.Capacity = Native.MAX_DEV_LEN;
                for (i = 0; Native.SetupDiEnumDeviceInfo(hDevInfo, i, DeviceInfoData); i++)
                {
                    //Declare vars
                    while (!Native.SetupDiGetDeviceRegistryProperty(hDevInfo,
                                                                    DeviceInfoData,
                                                                    Native.SPDRP_DEVICEDESC,
                                                                    0,
                                                                    DeviceName,
                                                                    Native.MAX_DEV_LEN,
                                                                    IntPtr.Zero))
                    {
                        //Skip
                    }
                    HWList.Add(DeviceName.ToString());
                }
}



In the HWList Array all the devices are listed, but i need to check which device is connected to serial port(may be is it possible to do with the Device ID)
AnswerIsn't this the same question... Pin
leckey10-Sep-08 3:13
leckey10-Sep-08 3:13 
Questionprotection with rsa Pin
arminj10-Sep-08 1:00
arminj10-Sep-08 1:00 
AnswerRe: protection with rsa Pin
leppie10-Sep-08 1:13
leppie10-Sep-08 1:13 
GeneralRe: protection with rsa Pin
arminj11-Sep-08 10:51
arminj11-Sep-08 10:51 
Questionexcel open error "no overload for method Open takes 13 arguements" Pin
g_amol10-Sep-08 0:45
g_amol10-Sep-08 0:45 
AnswerRe: excel open error "no overload for method Open takes 13 arguements" Pin
Giorgi Dalakishvili10-Sep-08 0:54
mentorGiorgi Dalakishvili10-Sep-08 0:54 
AnswerRe: excel open error "no overload for method Open takes 13 arguements" Pin
leppie10-Sep-08 0:55
leppie10-Sep-08 0:55 
Questionwhat is method group? Pin
George_George10-Sep-08 0:42
George_George10-Sep-08 0:42 
AnswerRe: what is method group? Pin
g_amol10-Sep-08 0:53
g_amol10-Sep-08 0:53 
GeneralRe: what is method group? Pin
leppie10-Sep-08 0:57
leppie10-Sep-08 0:57 
GeneralRe: what is method group? Pin
George_George10-Sep-08 1:03
George_George10-Sep-08 1:03 
GeneralRe: what is method group? Pin
J4amieC10-Sep-08 1:20
J4amieC10-Sep-08 1:20 
GeneralRe: what is method group? Pin
George_George10-Sep-08 1:28
George_George10-Sep-08 1:28 
AnswerRe: what is method group? Pin
leppie10-Sep-08 0:53
leppie10-Sep-08 0:53 
GeneralRe: what is method group? Pin
George_George10-Sep-08 1:05
George_George10-Sep-08 1:05 
GeneralRe: what is method group? Pin
leppie10-Sep-08 1:09
leppie10-Sep-08 1:09 
GeneralRe: what is method group? Pin
George_George10-Sep-08 1:12
George_George10-Sep-08 1:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.