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

Taskbar Context Menu

Hello everyone! :)

In case anyone wanted to replace the winxp system menu that pops up
every time you right click your apps taskbar button with your own
context menu read on...

I googled a little and i found that there is an undocumented 0x0313
windows message that's sent when the user rightclicks the taskbar button:

private const int WMTaskbarRClick = 0x0313;

All you have to do is to override the WndProc function and catch the
message in there like this:

protected override void WndProc(ref Message m)
{
switch(m.Msg)
{
case WMTaskbarRClick:
{
// Show your own context menu here, i do it like this
// there's a context menu present on my main form so i use it

int contMenuX = Cursor.Position.X - this.Location.X;
int contMenuY = Cursor.Position.Y - this.Location.Y;

Point contMenuPos = new Point(contMenuX, contMenuY);

this.contMenu.Show(this, contMenuPos);

break;
}
}

base.WndProc(ref m);
}

Hope this is of some use to anyone. ;)
Aug 29 '06 #1
0 9930

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

Similar topics

0
by: Will Pittenger | last post by:
I have a C# .NET program which does without a normal titlebar for its main window. Trouble is, I still want the user to be able to access select commands while the program is minimized. (I...
1
by: PL | last post by:
How to insert an item to the Application menu in the Taskbar with C#?
3
by: Maka Sili | last post by:
Hi, My VC++ application does not have a titlebar (and therefore no System menu, no minimize, no maximize and no close button). We have a custom button for minimize and close. When the app...
0
by: Oney | last post by:
Can I catch windows taskbar mouse events with Javascript( on the taskbar right click mouse and click close on the menu) When browser is open, on the taskbar mouse right click, click window...
2
by: | last post by:
Hello, I'm trying to add a "Send to Notification Area" item to the context menu for my application's taskbar button. (For example, right-click a CHM file (i.e., SQL Server BOL) in the taskbar,...
1
by: Joe Cool | last post by:
I know how to manipulate the text in a Taskbar Icon, but can you display a graphical style progress bar there?
3
by: Jimmy | last post by:
I'm kinda newbie to python and wxPython. Now I'm confronting a thorny problem: how can I make my program minimize to the taskbar represented as an ico, and when there is some message from network...
0
by: bz | last post by:
Hi, I need an app to run in kiosk mode, so user will not have access to start menu and taskbar while the app is running I was able to hide / show the taskbar with trhe following code when app...
0
by: aaronyoung | last post by:
Is there a way, in Access, to create a custom menu bar that can be used as the default menu bar that will, in essence, function like the Window's Taskbar? I would like the menu bar to show all...
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
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.