How to catch usb event
-
Hi there. Is there any way I can catch an event, when i plug a cable from my device to a computer? When there is an active connection between the two devices I want to show a dialog box in my mobile application. Haolan
Please check Windows Mobile API there is lot of system states.
Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com
-
Please check Windows Mobile API there is lot of system states.
Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com
-
Hi Please search in msdn2.microsoft.com There are you can find get all system sattes.
Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com
-
Hi Please search in msdn2.microsoft.com There are you can find get all system sattes.
Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com
I found this: http://msdn2.microsoft.com/en-us/library/microsoft.windowsmobile.status.systemstate.activesyncstatus.aspx[^] With this I have written the following code: void activeSyncState_Changed(object sender, ChangeEventArgs args) { ActiveSyncStatus status = (ActiveSyncStatus)args.NewValue; try { if (status == ActiveSyncStatus.Synchronizing) { MessageBox.Show("Hello world!"); } } catch (Exception ex) { // Handle Exception } } SystemState activeSyncState = new SystemState(SystemProperty.ActiveSyncStatus); activeSyncState.Changed += new ChangeEventHandler(activeSyncState_Changed); But when I plug in my cable nothing happens. But I guess I dont use the right api, because I need to fire my event when a connection is established and not when activesync is synchronizing. Is there any way to do that?
-
I found this: http://msdn2.microsoft.com/en-us/library/microsoft.windowsmobile.status.systemstate.activesyncstatus.aspx[^] With this I have written the following code: void activeSyncState_Changed(object sender, ChangeEventArgs args) { ActiveSyncStatus status = (ActiveSyncStatus)args.NewValue; try { if (status == ActiveSyncStatus.Synchronizing) { MessageBox.Show("Hello world!"); } } catch (Exception ex) { // Handle Exception } } SystemState activeSyncState = new SystemState(SystemProperty.ActiveSyncStatus); activeSyncState.Changed += new ChangeEventHandler(activeSyncState_Changed); But when I plug in my cable nothing happens. But I guess I dont use the right api, because I need to fire my event when a connection is established and not when activesync is synchronizing. Is there any way to do that?
Hi i tried same code it's work for me it's wok please double checok u registrated dll in ur enumaltor Thank you
Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com