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
  1. Home
  2. General Programming
  3. C#
  4. LPARAM value of the usb device

LPARAM value of the usb device

Scheduled Pinned Locked Moved C#
question
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Blubbo
    wrote on last edited by
    #1

    I do know that there is a way to get the LPARAM value of the usb device when the WndProc detects the usb device change (arrival or removal). The question is... is there a way to get the LPARAM value of the device when you turn on the software (with the usb device already plugged in and powered up)?

    L A 2 Replies Last reply
    0
    • B Blubbo

      I do know that there is a way to get the LPARAM value of the usb device when the WndProc detects the usb device change (arrival or removal). The question is... is there a way to get the LPARAM value of the device when you turn on the software (with the usb device already plugged in and powered up)?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      LPARAM is a C/C++ type defined & used by Windows for passing values with messages, it has nothing to do with USB devices. Also, does you question relate in any way to C#?

      Use the best guess

      B 1 Reply Last reply
      0
      • L Lost User

        LPARAM is a C/C++ type defined & used by Windows for passing values with messages, it has nothing to do with USB devices. Also, does you question relate in any way to C#?

        Use the best guess

        B Offline
        B Offline
        Blubbo
        wrote on last edited by
        #3

        yes. I'm overriding WndProc method to catch unplugging & plugging of the usb device. However is that the LParam is acquired in this WndProc process. When the software launches, the LParam for each device isn't acquired. Also I was thinking of the other way around to get that is by restarting the usb devices at startup to trigger "unplugging" and acquire LParam. Unsure of the way to do this either.

        L 1 Reply Last reply
        0
        • B Blubbo

          yes. I'm overriding WndProc method to catch unplugging & plugging of the usb device. However is that the LParam is acquired in this WndProc process. When the software launches, the LParam for each device isn't acquired. Also I was thinking of the other way around to get that is by restarting the usb devices at startup to trigger "unplugging" and acquire LParam. Unsure of the way to do this either.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Another guessing game! I have no idea what message you are trying to process, nor what values you should be receiving when the device changes status. And as I said before, devices have no concept of LPARAM.

          Use the best guess

          1 Reply Last reply
          0
          • B Blubbo

            I do know that there is a way to get the LPARAM value of the usb device when the WndProc detects the usb device change (arrival or removal). The question is... is there a way to get the LPARAM value of the device when you turn on the software (with the usb device already plugged in and powered up)?

            A Offline
            A Offline
            Alan N
            wrote on last edited by
            #5

            I assume your software is watching for WM_DEVICECHANGE messages where WParam is either DBT_DEVICEARRIVAL or DBT_DEVICEREMOVECOMPLETE. LParam will then point to a device dependent structure, related to DEV_BROADCAST_HDR, containing device information. Windows Management Instrumentation can probably provide similar information for connected devices but without knowing their type and the information you need it's impossible say more. Alan.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

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