USB Flash memory arrive/remove notification
Results 1 to 2 of 2

Thread: USB Flash memory arrive/remove notification

  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    1

    USB Flash memory arrive/remove notification

    Hi everybody,

    I'm developing a application to run over Windows XP embedded and have some troubles with
    the usb flash memory handling.

    My application needs to do some job when a USB flash memory is Removed/Inserted in any

    available USB port.

    I am using the Windows Messages WM_DEVICECHANGE with the flags DBT_DEVICEARRIVAL and

    DBT_DEVICEREMOVECOMPLETE. It works very well after the the usb flash memory has been used in

    the computer where the application run.

    But, When the application is running and a flash memory is inserted by first time in the

    computer, Windows sends the WM_DEVICECHANGE-DBT_DEVICEARRIVAL followed by a WM_DEVICECHANGE

    -DBT_DEVICEREMOVECOMPLETE and other WM_DEVICECHANGE-DBT_DEVICEARRIVAL. In this case, the

    behavior of the application is apparently wrong because it process the Device Remove message

    and the flash memory is still inserted in the USB Port.

    Is there any diference between the WM_DEVICECHANGE-DBT_DEVICEARRIVAL message sent by Windows

    the first time that a flash memory is inserted in a computer?

    Does anyone know how to identify this first WM_DEVICECHANGE-DBT_DEVICEARRIVAL?

    I have another issue, sometimes take few seconds to detect the WM_DEVICECHANGE-

    DBT_DEVICEARRIVAL or WM_DEVICECHANGE-DBT_DEVICEREMOVECOMPLETE. is this a isolated issue or

    any of you have seen something like that?

    Thanks for any help

  2. #2
    Geezer confus-ed's Avatar
    Join Date
    Jul 1999
    Location
    In front of my PC....
    Posts
    13,087
    Quote Originally Posted by gcfreddy
    ..Is there any diference between the WM_DEVICECHANGE-DBT_DEVICEARRIVAL message sent by Windows

    the first time that a flash memory is inserted in a computer?..
    Yup, the plug & play service will have fired & be busy trying to check if its got drivers etc..

    & if I remember my windows api programming experience correctly, that means the usb card gets marked as removed until the plug & play service reports 'approval' ..

    This is something you might just have to 'live with' & maybe the simplest answer is just programming in a pause, rather than doing whatever methods are needed to check everything is ok at that very precise moment ?

Similar Threads

  1. Replies: 1
    Last Post: April 10th, 2006, 10:55 AM
  2. Replies: 1
    Last Post: April 8th, 2005, 07:32 AM
  3. PCMCI - USB 2.0 & USB 2.0 external hard
    By Marinero in forum USB/Firewire
    Replies: 14
    Last Post: May 8th, 2004, 07:23 AM
  4. My computer stole my playstation's memory...
    By jaeger in forum Tech Lounge & Tales
    Replies: 17
    Last Post: June 20th, 2002, 04:48 PM
  5. [RESOLVED] Standard mode - HIMEM.SYS
    By Venus in forum Windows 95/98/98SE/ME
    Replies: 2
    Last Post: June 11th, 2001, 05:53 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •