Catch synchronization messages in your application class.
Prérequis
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.
![]() |
Discuter à propos de cette page dans DocCommentXchange.
|
Copyright © 2013, SAP AG ou société affiliée SAP - SAP Sybase SQL Anywhere 16.0 |