471,321 Members | 1,627 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,321 software developers and data experts.

TrackPopupMenu problem

BEP
I am using TrackPopupMenu (taken from user32.dll) to open a context
menu within an editor. About 1/2 of the time, the menu works as
expected--opens on right click, and you can move away and it
disappears, or choose one of the menu items and the command fires.
However, sometimes instead, the context menu opens and then instantly
the options disappear and just a tiny box is left instead of the menu
with items.

I have tried other fixes I found for TrackPopupMenu (using
SetForeground and PostMessage) and setting different flags. None of
these seem to matter. My menu items are not getting disposed (according
to breakpoint set in debugger) and I can't find any other events that
would be interefering.

Any ideas? As an additional weird fact, there are three different
context menus--one when the mouse is over a link, one for images, and
one for plain text. The problem happens 95% of the time you right click
on a link, about 15% for images, and maybe 5% for plain text.

The call is very simple:
int menuID = User32.TrackPopupMenu(Handle,
TPM.NONOTIFY | TPM.RETURNCMD,
position.X,
position.Y,
0,
parentWindow.Handle,
IntPtr.Zero);

Thanks!

BEP

Jan 4 '06 #1
0 1794

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Bruce Davis | last post: by
11 posts views Thread by Kostatus | last post: by
9 posts views Thread by Sudesh Sawant | last post: by
117 posts views Thread by Peter Olcott | last post: by
28 posts views Thread by Jon Davis | last post: by
6 posts views Thread by Ammar | last post: by
2 posts views Thread by Mike Collins | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.