Catch synchronization messages in your application class.
Prerequisites
You must use Microsoft Foundation Classes to develop your application.
Your application must create and register a custom window class name for notification.
Open the Class Wizard for the application class.
In the Messages list, highlight PreTranslateMessage and then click Add Function.
Click Edit Code.
The PreTranslateMessage method appears.
Change the PreTranslateMessage method to read as follows:
BOOL CMyApp::PreTranslateMessage(MSG* pMsg) { if( ULIsSynchronizeMessage(pMsg->message) ) { DoSync(); // close application if launched by provider if( pMsg->wParam == 1 ) { ASSERT( AfxGetMainWnd() != NULL ); AfxGetMainWnd()->SendMessage( WM_CLOSE ); } return TRUE; // message has been processed } return CWinApp::PreTranslateMessage(pMsg); } |
where the DoSync method calls the ULSynchronize method.
![]() |
Discuss this page in DocCommentXchange.
|
Copyright © 2014, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0 |