Larry,
I never write Carbon event code before. So I have the following
two questions:
1. After running the function installEventHandler that installs the
MonitorHandler function and loop to wait a volume event comes up, but it
never. Which kind of events I need to register in the following kEvent
array?
installEventHandler(void)
{
EventTypeSpec kEvent[] =
{
{kEventClassVolume, kEventCommondProcess}
};
InstallEvenHandler(GetEventMonitorTarget(),MonitorHandler,
GetEvenTypeCount(kEvents)), kEvents,
0, &myHandler);
RunApplicationEventLoop();
}
static OSStatus
MonitorHandler( EventHandlerCallRef inCaller,
EventRef inEvent, void* inRefcon )
{
FSVolumeRefNum volRefNum;
// get the event class
switch ( GetEventClass( inEvent ) )
{
case kEventClassVolume:
switch ( GetEventKind( inEvent ) )
{
case kEventVolumeMounted:
case kEventVolumeUnmounted:
GetEventParameter(
inEvent,
typeFSVolumeRefNum,
kEventParamDirectObject
NULL,
sizeof(FSVolumeRefNum),
NULL,
&volRefNum);
break;
default:
break;
}
break;
default:
break;
}
return noErr;
}
2. Using Event method, It seems I still cannot recognize if the mounted
volume is or not a USB flash mem stick.
Is there any way to tell if the device of the mounted volume is or not a
USB flash mem stick?
Thanks
Ben
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden
This email sent to email@hidden