The transmission of user-defined events is an effective method for inter-Application Communication. User-Defined events must be greater than or equal to evt_user (0x7000). ishell_registerevent () can be used to register custom aeeevent based on the input string. This function allows applications to dynamically reserve event backups without worrying about conflicts with other evt_user Event code. It should be noted that the event is only valid within one cycle of the on/off server. The same event registered next time on/off server may return different aeeevents. If a pointer to pncount is provided, the number of times the event is registered is updated.
The event is sent to the activated dialog box or application through ishell_sendevent () to control the target application. This function sends events directly to the target application. You can send events to a specific application by specifying the target application. If the application is not running, the application is loaded and an event is sent directly to the application. At this time, the application will be started in the background (the evt_app_start and evt_app_stop events will not be sent to the application ). Ishell_postevent () is used to transmit asynchronous events to a specified application. This function is similar to the ishell_sendevent () function. The main difference is that ishell_sendevent () sends an event to the application immediately.
Event transfer is provided in special cases, such as passing events from other tasks by the calling program, or delaying event processing to the next event loop. Ishell_posteven tex () is used to transmit asynchronous events to a specified application. This function is very similar to the ishell_postevent () function. The main difference is that this function allows the same application to pass multiple events of the same type (the same event code) and queue events for distribution.
After brew 3.x, the application can send the specified evt_app_post_url synchronously or asynchronously to another application through ishell_sendurl () and ishell_posturl (). After the other application receives the evt_app_post_url event, data in the event can be obtained to complete communication.