|
|||
Mobile Messenger: Windows Named Event APIWindows Named Event APIMobile Messenger supports a new way of sending SMS; Windows Event To SMS. This allows other applications to raise a named event (like waving a flag). When the event is raised, Mobile Messenger reacts to this by sending a message to the recipient(s) that you specify. You can configure these messages and the recipients. On start-up Mobile Messenger creates a set of Windows Named Events (or simply attaches to them if they already exist) and listens for the events to be raised. This is an extremely processor efficient activity and so does not impact the normal operation of Mobile Messenger at all when no events are being raised. The events are all named using a standard naming format: MOBILE_MESSENGER_EVENT_FLAG_1 to where N is currently 10. You can configure the messages to be sent and the recipient(s), when an event is raised, via the Mobile Messenger Event Messages screen. If you are using an application or plug-in to raise the events, it may well include a simplified version of this this screen and you should use that instead. If you are writing your own program to raise the events, you will need to use this screen as you do not have access to the required API for storing this information (this may be provided in a later release). Writing Visual C++When writing your own application in Visual C++ you will need to use the CreateEvent method to get a handle to the event you want to raise. Once you have a valid handle you can call the SetEvent method to raise the event. It will automatically be reset, you do not need to do this yourself. Remember to call CloseHandle when you have finished. For example: void CMyClass::OnAlarmSystemActivated()
{
CString strEventName("MOBILE_MESSENGER_EVENT_FLAG_1");
// create the event, this will most likely already exist so we just get a handle to the existing event back
HANDLE hEventHandle = CreateEvent(NULL, FALSE, FALSE, (LPCTSTR)strEventName);
// if we got a valid handle back, then raise the event and close the handle
// mobile messenger takes it from here on
if(hEventHandle != NULL)
{
SetEvent(hEventHandle);
CloseHandle(hEventHandle);
}
}
A sample Visual C++ application can be downloaded from the website where you obtained the Mobile Messenger application. |
|||
|
SMS This page was last modified at 10:27 UTC on Wednesday February 20, 2008 |