Context Menu Size.

N

news.microsoft.com

Hi everyone,



Please I'm creating a Context Menu and doing a manual Show from C#, on a
different thread I need to know the window size of the Context Menu already
opened, I have the object created and I have the reference to it, and I have
the handle, but I cannot get the window information.



..Net Context Menu doesn't offer nothing to get this info.



I tried calling the Window API

GetClientRec and GetWindowRec sending the handle to the context menu, but it
always return 0.



I don't know how can I get the information to that window, basically I need
location and Size.



I'm kind of hurry with it. Please if you know let me know.



Thanks,

Gustavo.
 
H

Herfried K. Wagner [MVP]

* "news.microsoft.com said:
GetClientRec and GetWindowRec sending the handle to the context menu, but it
always return 0.

How did you try to get the context menu's /window/ handle?
 
A

Andrew \(Infragistics\)

The handle property of the menu is not a window handle; I believe its an
HMENU. You can try looking at the menu related apis (e.g. GetMenuItemRect)
but I don't believe there is a way to get to the window handle of the
context menu from an hmenu.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top