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
B

brian shapiro

@brian shapiro
About
Posts
13
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • WMI and the difference between memory cards and USB drives
    B brian shapiro

    Just so people reading this know... it turns out the original solution I found is working again. I don't know if it was a glitch in how my system was reporting the information or whether the second, more thorough method is just more fool-proof. I'm getting the power data through setupapi.dll rather than through powerprof.dll though, since I'm trying to move away from WMI.

    C# hardware performance

  • WMI and the difference between memory cards and USB drives
    B brian shapiro

    It was my error; the problem was it didn't find a drive with that drive letter because it was referring to the Portable Device, and thats listed by the Volume name if there is one. But I finally found something that works! If you enumerate the hardware ID strings for the devices that support D2, the only ones that show up are the ones for flash drives. The memory cards are enumerated I think, but a query for the hardware ID returns an empty string. So you have to find the PnPEntity associated with the DiskDrive, and take the first indexed HardwareID. No problems with this so far..

    C# hardware performance

  • WMI and the difference between memory cards and USB drives
    B brian shapiro

    Except that only seems to work for one flash drive I have and not another. I'll continue to investigate that.

    C# hardware performance

  • WMI and the difference between memory cards and USB drives
    B brian shapiro

    I figured out what I did wrong --- you have to do a check on the Logical Disk name, not the Disk Drive name. The Disk Drive for the card reader supports more power states, and the Portable Device (listed in Device Manager) supports even more, including D1.

    C# hardware performance

  • WMI and the difference between memory cards and USB drives
    B brian shapiro

    Actually, this doesn't seem to be working.. I thought it was, but I must have been mistaken. The internal card readers don't support D2, but the external card readers do.

    C# hardware performance

  • WMI and the difference between memory cards and USB drives
    B brian shapiro

    Based on the devices that I have, I figured out that you can expect a USB Flash Drive to have PDCAP_D2_SUPPORTED under "Power data" in Device Manager, but not a memory card. So I used a PInvoke to DevicePowerEnumDevices in PowrProf.dll ( http://msdn.microsoft.com/en-us/library/aa372681(VS.85).aspx[^] ). That allowed me to filter by the device name in Win32_DiskDrive.Model and the PDCAP_D2_SUPPORTED flag.

    C# hardware performance

  • WMI and the difference between memory cards and USB drives
    B brian shapiro

    Actually it kind of would serve my purpose -- I just want to determine whether a logical disk is hosted by a card reader, or is hosted by a USB drive. If I could determine the 'bus reported' description for any given USB Mass Storage Device.. but I don't know how to do that. Can you help?

    C# hardware performance

  • WMI and the difference between memory cards and USB drives
    B brian shapiro

    I've noticed in Device Manager that the Mass Storage Devices for the multi-card readers I own have a "Bus reported device description" of "Mass Storage Device" -- a generic name -- but the one for the USB drive instead has the description of the device name. Is this at all significant? And where does the "Bus reported device description" come from?

    C# hardware performance

  • WMI and the difference between memory cards and USB drives
    B brian shapiro

    How would I determine that? Just look up if there's more than one dependent drive on to the USB Mass Storage device? But I want to account for cases in which the card reader is only able to read one type of card, and I'm not sure how this is distinguishable in WMI.

    C# hardware performance

  • WMI and the difference between memory cards and USB drives
    B brian shapiro

    I want to use WMI to tell the difference between a removable media thats a memory card and a USB drive. It would seem there is some way, because on the menu for Safely Remove Hardware you can choose to eject the disks in a card reader individually while not ejecting the hardware (a mass storage device), while for a USB drive you're choosing to eject the drive. Brian

    C# hardware performance

  • Windows 7, SetWindowPos, and AnimateWindow
    B brian shapiro

    I have a project where I'm using SetWindowPos through pinvoke to show a frameless window. In Windows Vista, when the window would load, there would be no window opening animation, but now that I'm running the project in Windows 7 the animation is there. I'm now trying to use AnimateWindow to change the opening animation so that the length is 0. But I'm having trouble accomplishing anything with AnimateWindow except changing the behavior to hiding the window instead of showing it. Is there anyone who can help? Do we have any forum here specifically for Win32 API discussions?

    C# json help question

  • Can I retrieve Clocks associated with HasAnimatedProperties
    B brian shapiro

    Is there any way to programatically retrieve whatever clock is controlling a UIElement with HasAnimatedProperties, so you can hook an event handler to timeline events that were created by a style template?--without parsing the raw XAML. I need my control to wait until any animations are completed to effect a change in state.

    WCF and WF wpf json question

  • How to use RoutedCommands like TogglePlayPause
    B brian shapiro

    I'm wondering what the practice is for using a command that toggles states between two other commands. If I implemented something like the existing command TogglePlayPause, how would it notify the button what state it should be in, pause or play--without creating a custom button control? What I'm trying to do is implement a ToggleMaximizeRestore for a frameless window, and I'm not sure how to implement it so that all of the command logic is taken care of.

    WCF and WF tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups