Windows CE detects a PC Card when it is inserted or if it is in place when a user starts an H/PC. The OS automatically loads the device drivers needed to use the card when it detects a supported PC Card.
All active, top-level windows receive a WM_DEVICECHANGE message from the OS when a PC Card is first inserted. To determine if a PC Card was inserted before the application started running, call the EnumPnpIds function. It returns a double-0-terminated list of 0-terminated Plug and Play identifiers of all active PC Cards. Generally, the list returned from EnumPnpIds contains only one member because most H/PCs have only one PC Card slot.
Alternatively, Telephony API (TAPI) applications can call the LineGetDevCaps function to determine if a particular modem is inserted into the PC Card slot on an H/PC. The devSpecific member of the LINEDEVCAPS structure returned from LineGetDevCaps contains the device type and indicates whether or not it is active.