Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm having problems displaying a popup menu from the OnRButtonDown handler of my AcPane derived class. The first problem is positioning the menu I'm using this:
//------------------------------------------------------------------------------
void MyPane::OnRButtonDown(UINT nFlags, CPoint pt)
//------------------------------------------------------------------------------
{
CMenu Menu;
AcApStatusBar* pStatus = acedGetApplicationStatusBar();
if (pStatus != NULL)
{
HWND hwndStatusBar = NULL;
HWND hwndStatusBarHost = ::GetDlgItem(adsw_acadMainWnd(), 0xE801);
if (hwndStatusBarHost != NULL)
{
hwndStatusBar = GetWindow(hwndStatusBarHost, GW_CHILD);
}
::ClientToScreen(hwndStatusBar, &pt);
This doesn't give the correct coordinates on my multi-monitor system. Does anyone know how to convert between the results of ClientToScreen and the virtual desktop?
The second problem is that all my popup menu items are disabled, despite being enabled in the resources. Even if I iterate through them and specifically enable them, they are still disabled. How can I fix that?
Solved! Go to Solution.