Ejemplo n.º 1
0
        public static IntPtr Register(IntPtr hWnd, Guid classGuid, DeviceNotificationFlags flags)
        {
            DevBroadcastDeviceInterface dbi = new DevBroadcastDeviceInterface();

            dbi.dbcc_size       = Marshal.SizeOf <DevBroadcastDeviceInterface>();
            dbi.dbcc_devicetype = DeviceType.DeviceInterface;
            dbi.dbcc_classguid  = classGuid;

            GCHandle gch = GCHandle.Alloc(dbi, GCHandleType.Pinned);

            IntPtr handle = NativeMethods.RegisterDeviceNotification(hWnd, gch.AddrOfPinnedObject(), flags);

            gch.Free();

            return(handle);
        }
Ejemplo n.º 2
0
 public static extern IntPtr RegisterDeviceNotification(IntPtr recipient, IntPtr notificationFilter, DeviceNotificationFlags flags);
 public static extern IntPtr RegisterDeviceNotificationW(
     IntPtr hRecipient,
     ref DevBroadcastDeviceInterfaceW notificationFilter,
     DeviceNotificationFlags flags
     );
Ejemplo n.º 4
0
        public static extern IntPtr RegisterDeviceNotification(
			IntPtr recipient,
			BroadcastHdr filter,
			DeviceNotificationFlags flags);
Ejemplo n.º 5
0
 public static extern IntPtr RegisterDeviceNotification(IntPtr recipient, BroadcastHdr filter, DeviceNotificationFlags flags);