How do I make a button respond to a right click event? Whenever I right click on any part of a window of my prog, it shows the popup menu I created but when I right click on the button, it doesn't show. Any ideas how?
:D
-- audioman
:D
-- audioman
Use SetWindowLong on the Button with the GWL_WNDPROC and pipe it's messages through another WindowProc where you catch the WM_RBUTTONDOWN message and show your PopupMenu.
Check out Iczelions Tut about subclassing : http://win32assembly.online.fr/tut20.html
Check out Iczelions Tut about subclassing : http://win32assembly.online.fr/tut20.html
Hmm.. ok. Here's the problem now: Whenever i make a subclass of the button, it doesn't respond to the mouse events.
here's what i did: (pseudo code)
It doesn't respond to any mouse clicks, when i click on it, it doesn't push the button.. but when i dont subclass it, it works..
--audioman
here's what i did: (pseudo code)
New Proc part:
if msg = WM_RBUTTONDOWN
show popmenu
else
invoke CallWindowProcA
endif
It doesn't respond to any mouse clicks, when i click on it, it doesn't push the button.. but when i dont subclass it, it works..
--audioman
Attached code works..
Added WM_COMMAND handler for both Menu & Button as previous code had a little error
Added WM_COMMAND handler for both Menu & Button as previous code had a little error
Your code works when I put it in a new file but when I applied it to my program, it still doesnt work. I think it doesn't work because of the mousehook.. any ideas?
EDIT: Just tested it again, I removed the mousehook code, it still doesn't work. So, it musn't be the mousehook.
EDIT2: I got it now. The problem I included a pushad/popad in the new Procedure.
Thanks for your help!
:D
--audioman
EDIT: Just tested it again, I removed the mousehook code, it still doesn't work. So, it musn't be the mousehook.
EDIT2: I got it now. The problem I included a pushad/popad in the new Procedure.
Thanks for your help!
:D
--audioman
You're welcome.