473,725 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to get RECT or DC of context menu ?

Hi

I'm wondering whether is existing any working way of
getting real metrics about the active ContextMenu.
For example ContextMenu(.ne t) expose window handler
which I tried to use in GetWindowRect call - failed result;
Next i tried to get its DC - failed result too.
Finally I tried to get some info about menu with SPY++ but
it reported that windows cannot provide such info ?-)
Indeed developer cannot handle this one ? Is it a top secret :-)
Perhaps somebody know any workaround ...

Thanks
Yuri
Nov 15 '05 #1
3 2595

"Yuri O." <ps****@tut.b y> schreef in bericht
news:uB******** ******@TK2MSFTN GP10.phx.gbl...
Hi

I'm wondering whether is existing any working way of
getting real metrics about the active ContextMenu.
For example ContextMenu(.ne t) expose window handler
which I tried to use in GetWindowRect call - failed result;
Next i tried to get its DC - failed result too.
Finally I tried to get some info about menu with SPY++ but
it reported that windows cannot provide such info ?-)
Indeed developer cannot handle this one ? Is it a top secret :-)
Perhaps somebody know any workaround ...

Thanks
Yuri


I don't know how to get the info for the entire contextmenu, but you could
get the info for every item on that menu and maybe add that together to get
the full info. If you want to get the info for one menuitem look up
ownerdrawn menus.

Yves
If you make them ownerdrawn you
Nov 15 '05 #2
I'm looking for the same answer too.

I'm doing ownerdrawn and I tought of that, but with that I cannot get the
location of the windows, just the Size.

I mean I really need the real information, because if you do with ownerdrawn
you get the relatives values and not the absoulutes values, then the problem
is the next.

if you Display the context menu close to the Bottom of the screen windows
will decide that the menu has to go up instead go down, if you get the info
from ownerdrawn it only will be the size, if there is some chance to get the
location, then you have to do manual calculation between the workspace
size - location to know if it is bigger than the Size in that case the menu
is going up.

But all this is gonna work only for W2000 and after, because on W95/98/me
the context menu always is going down, then to get some simple information
like location and size can be a very painfull process, I cannot beleive that
there is not way to get this info from the context menu.

Thanks,
Gustavo.
"phoenix" <pa******@skyne tWORK.be> wrote in message
news:uZ******** ******@TK2MSFTN GP11.phx.gbl...

"Yuri O." <ps****@tut.b y> schreef in bericht
news:uB******** ******@TK2MSFTN GP10.phx.gbl...
Hi

I'm wondering whether is existing any working way of
getting real metrics about the active ContextMenu.
For example ContextMenu(.ne t) expose window handler
which I tried to use in GetWindowRect call - failed result;
Next i tried to get its DC - failed result too.
Finally I tried to get some info about menu with SPY++ but
it reported that windows cannot provide such info ?-)
Indeed developer cannot handle this one ? Is it a top secret :-)
Perhaps somebody know any workaround ...

Thanks
Yuri

I don't know how to get the info for the entire contextmenu, but you could
get the info for every item on that menu and maybe add that together to

get the full info. If you want to get the info for one menuitem look up
ownerdrawn menus.

Yves
If you make them ownerdrawn you

Nov 15 '05 #3
Maybe the following can help a little
http://www.visual-basic.com.ar/vbsma...martmenuxp.htm

It's in VB6 though. It looks like the guy found out which class is used for
menus. If you could get the message loop of your program you could try to
filter it out and look at the data there. But i never tried anything like it
in dotnet yet.

Yves

"news.microsoft .com" <gu************ @hotmail.com> schreef in bericht
news:e7******** ******@TK2MSFTN GP10.phx.gbl...
I'm looking for the same answer too.

I'm doing ownerdrawn and I tought of that, but with that I cannot get the
location of the windows, just the Size.

I mean I really need the real information, because if you do with ownerdrawn you get the relatives values and not the absoulutes values, then the problem is the next.

if you Display the context menu close to the Bottom of the screen windows
will decide that the menu has to go up instead go down, if you get the info from ownerdrawn it only will be the size, if there is some chance to get the location, then you have to do manual calculation between the workspace
size - location to know if it is bigger than the Size in that case the menu is going up.

But all this is gonna work only for W2000 and after, because on W95/98/me
the context menu always is going down, then to get some simple information
like location and size can be a very painfull process, I cannot beleive that there is not way to get this info from the context menu.

Thanks,
Gustavo.
"phoenix" <pa******@skyne tWORK.be> wrote in message
news:uZ******** ******@TK2MSFTN GP11.phx.gbl...

"Yuri O." <ps****@tut.b y> schreef in bericht
news:uB******** ******@TK2MSFTN GP10.phx.gbl...
Hi

I'm wondering whether is existing any working way of
getting real metrics about the active ContextMenu.
For example ContextMenu(.ne t) expose window handler
which I tried to use in GetWindowRect call - failed result;
Next i tried to get its DC - failed result too.
Finally I tried to get some info about menu with SPY++ but
it reported that windows cannot provide such info ?-)
Indeed developer cannot handle this one ? Is it a top secret :-)
Perhaps somebody know any workaround ...

Thanks
Yuri


I don't know how to get the info for the entire contextmenu, but you could get the info for every item on that menu and maybe add that together to

get
the full info. If you want to get the info for one menuitem look up
ownerdrawn menus.

Yves
If you make them ownerdrawn you


Nov 15 '05 #4

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

Similar topics

4
3070
by: Mohit Gupta | last post by:
Hi all, Lately I have been working on an application in VB .net CF for Pocket PC device. I have a small question about Context Menu. When I try to close the window after context menu is poped up, the window does not closes until I click on the window. Below is the code. Hopefully, you can help me out.
5
5491
by: Dean L. Howen | last post by:
Dear friends, Could we determine when context menu should appear?
8
10099
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 a text box has 6 items, undo, cut, copy, paste, delete and select all. I would like to add one additional paste menu that opens a new sub menu with several optional text items that could be pasted. The items would be populated by my program but...
1
6339
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 etc'). is there a way making this without writing my own context menu (meaning, popup form or something) ? Please don't post commercial products to this topic thanks.
0
9392
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9246
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9091
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8069
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6694
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4505
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3211
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2619
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2150
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.