AnnoUIOnRButtonDownExt

#include “BiAnno.h”

BOOL CALLBACK AnnoUIOnRButtonDownExt (        INT_PTR PAnno,
HWND hWnd,

                                                                              LPVOID pMenu,

                                                                              HDC     hDC,
UINT    nFlags,
POINT  point );

Description

Handles user interface task when right mouse button is pressed.  It must be called on the WM_RBUTTONDOWN message handler function, if the mouse pointer is given to the annotation handler. The parameter point must be mapped to the image.

Parameters

INT_PTR

pAnno

Annotation handle

WHND

hWnd

Window handle. This window retrieves messages when the user click on a menu item in the custom pop-up menu.

LPVOID

pMenu

Pointer to the custom menu.

HDC

hDC

DC to paint onto if necessary

UINTnFlags

nFlags 

Indicates whether various virtual keys are down.

POINT

point

Mouse coordinates

Return value

TRUE if repaint is necessary.

The update area can be obtained by the AnnoUIGetUpdateRect function. If any error occurs, you can call the AnnoGetLastError function for the last error code.

Programming Notes

See AnnoUIOnRButtonDown for more information. See AnnoCreateCustomMenu and AnnoAddCustomMenuItem functions for creating custom menus.

If you create a custom pop-up menu, this menu will be dispayed when you click the right mouse button. You can change the default pop-up menu in the annotation. When the user selects a menu item, a window message will be sent to the application. This message informs the user about the type of the selected annotation object and the selected menu item.

Code Example

DWORD dwCount;

 

            AnnoGetMenuItemsCount(m_pCustomMenu, dwCount);

 

            if (!m_pCustomMenu || dwCount == 0)

                        return AnnoUIOnRButtonDown( lAnno, hDC, nFlags, point );

            else

                        return AnnoUIOnRButtonDownExt(lAnno, AfxGetApp()->m_pMainWnd->m_hWnd, m_pCustomMenu, hDC, nFlags, point);