473,395 Members | 1,516 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,395 software developers and data experts.

Stop menu popup when a Window's icon is clicked?

Is it possible to stop the menu from appearing when you click the icon on a
Window's title bar? I'm wanting to use it as a button for a different
purpose. I've tried capturing all the messages that run through wndproc but
none of them relate to this menu.

Please help,

Darrell

Nov 16 '05 #1
1 1424
"redneon" <re*****@discussions.microsoft.com> wrote in message
news:CA**********************************@microsof t.com...
Is it possible to stop the menu from appearing when you click the icon on
a
Window's title bar? I'm wanting to use it as a button for a different
purpose. I've tried capturing all the messages that run through wndproc
but
none of them relate to this menu.


Yes, it's possible and you're on the right track. Try this:

protected override void WndProc(ref Message m)
{
const int WM_NCHITTEST = 0x0084;
const int HTCAPTION = 2;
const int HTSYSMENU = 3;

base.WndProc(ref m);

if (m.Msg == WM_NCHITTEST && m.Result == (IntPtr)HTSYSMENU)
{
// Window icon clicked
m.Result = (IntPtr)HTCAPTION;
}
}

This will disable the icon; clicking on it will have the same effect as
clicking
elsewhere on the title bar. Search WinUser.h for other possible HT values.

- Magnus


Nov 16 '05 #2

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

Similar topics

6
by: Baffin Shea | last post by:
Dear All, I am a beginner in javascript and looking for help, I put the following script in the original.asp: function NewWindows() { window.open("abc.asp", "new") }
5
by: Obantec Support | last post by:
Hi i leached some code and strung together a popup i need for a page with 5 help buttons. Now i could use 5 scripts and pre-load the values but i would rather get a better understanding of how...
4
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...
1
by: Ignacio X. Domínguez | last post by:
Hi everyone. Hope you can help me out on this one. I'm developing a Component which has a property ContextMenu. This component, when placed on a form with a working ContextMenu (events assigned...
2
by: Bonj | last post by:
Looking for a good example of how to show a popup menu in response to the user right-clicking on the icon in the 'taskbar notification area' (tray). I'm fine with creating the icon and responding to...
5
by: yxq | last post by:
Hi I am build vb6 Context menu extension, but how to determine which popup menu item(popupItem1 and popupItem2) was clicked? Thanks The code ' ' IContextMenu::QueryContextMenu '
9
by: john | last post by:
In Paradox I was able to create popup menu's in which some of the items had popup menu's themselves. I've looked for threads on popup menu's and access but I can't find how to make a simple popup...
8
by: starrysky | last post by:
I have a program which puts an icon in the notification area and has a menu associated with it available by right clicking on the icon. I want the menu items to be selected by single left clicks but...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.