Click here to Skip to main content
15,891,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What window message do I need to handle in other to handle mouse clicks on non region of a window? Specifically I need it to know when a user right clicks on a tab control so that I can display a floating menu with which the user can close one or more tabs as it is done in moilla firefox.
Posted
Comments
Gbenbam 4-Feb-14 9:12am    
Sorry about the omission.I meant "non-client region of a window"
Mohibur Rashid 4-Feb-14 11:05am    
you need to hook

1 solution

Those are special separate non-client messages: http://msdn.microsoft.com/en-us/library/windows/desktop/ms645618%28v=vs.85%29.aspx[^].

(In the MSDN article referenced above, look at the left part for all messages named as WM_NC*.)

However, you should understand what the client area is: http://msdn.microsoft.com/en-us/library/windows/desktop/dd162743%28v=vs.85%29.aspx[^].

In particular, tab areas are not non-client. Non-client area is everything between client rectangle and outer window bounds: borders, title bars…

—SA
 
Share this answer
 
Comments
Gbenbam 4-Feb-14 11:24am    
If I subclass the Tab control won't it receive WM_NC* that is meant for it?
Sergey Alexandrovich Kryukov 4-Feb-14 11:39am    
I don't think the tab has any non-client areas, or maybe this area is just the thin border around. It's more like button.
The tab notifications are described here:
http://msdn.microsoft.com/en-us/library/zyyskx80.aspx.

—SA

P.S.: and of course subclassing cannot make a client area non-client or visa versa. :-) Windows just look at window object and its "window class" in the sense of the Window API (non-OOP), as I tried to explain recently.
Gbenbam 6-Feb-14 5:48am    
So how would you suggest I monitor right clicking on the tab control
Sergey Alexandrovich Kryukov 6-Feb-14 8:25am    
As described in the MSDN article referenced above...
—SA
Gbenbam 6-Feb-14 5:55am    
Perhaps you should see this:
http://msdn.microsoft.com/en-us/library/windows/desktop/hh298378(v=vs.85).aspx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900