473,385 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Context Menu Size.

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.
Nov 20 '05 #1
3 3107
* "news.microsoft.com" <gu************@hotmail.com> scripsit:
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?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
this.Handle

There is another way?
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uS**************@tk2msftngp13.phx.gbl...
* "news.microsoft.com" <gu************@hotmail.com> scripsit:
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?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #3
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.

"news.microsoft.com" <gu************@hotmail.com> wrote in message
news:uY**************@tk2msftngp13.phx.gbl...
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.

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mike Stephens | last post by:
This is very simple and for the life of me the solution escapes me. How can I align a context menu to the right button of a button? Regards, Mike
3
by: Yuri O. | last post by:
Hi I'm wondering whether is existing any working way of getting real metrics about the active ContextMenu. For example ContextMenu(.net) expose window handler which I tried to use in...
1
by: news.microsoft.com | last post by:
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...
1
by: Abhi | last post by:
I've created a class "MRP123MenuItem" derived from inbuilt MenuItem class to give customized look and feel to the user. I've created context menus for different controls using mine...
8
by: Dennis C. Drumm | last post by:
Is there a way to modify the standard context menu shown when someone right clicks in a windows text box and that would work for all open windows applications? The standard context menu for...
0
by: Andrew Baker | last post by:
Have a look at the code below. It's a really simple example where I have added two controls to a form, a textbox and a combo box. Both add owner drawn context menus to the controls, but the...
1
by: goRide | last post by:
Hi, I'm looking of a way (preferred - a ready class or dll) to customize the context menu. many application has more controls inside the context menu (like textbox, sliders, checkbox, panel...
0
by: Patel | last post by:
Hi All, I am doing one INTERESTING work with Context Menu Strip. I am trying to insert a custom control / .Net control in Context menu as a context menu strip. I tried inserting MonthCalender in...
0
by: leosuth | last post by:
WHen creating menus, including the context menu, there is a blank 'entry' at the bottom of the menu where you can insert new menu items. When running the application, normal menus display correctly,...
2
by: Andreas Mueller | last post by:
Hi All, I'm trying to show a context menu during a drag drop operation similar to the windows explorers right click drag and drop behavior (A full working sample is at the end of the post): ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.