virtual BOOL PreTranslateMessage(MSG* pMsg);
-
Hello, I would like to stop all messages to the window taskbar. I try to use the PreTranslateMessage function and it seems that the messages to the taskbar are not sending throw this function. Do you know a way to catch the messages? Do you know if it should be throw this function? Thank a lot ;) !
-
Hello, I would like to stop all messages to the window taskbar. I try to use the PreTranslateMessage function and it seems that the messages to the taskbar are not sending throw this function. Do you know a way to catch the messages? Do you know if it should be throw this function? Thank a lot ;) !
TalSt wrote:
I would like to stop all messages to the window taskbar. I try to use the PreTranslateMessage function and it seems that the messages to the taskbar are not sending throw this function. Do you know a way to catch the messages?
Use
GetWindowLong
andGWL_WNDPROC
to get a window's main procedure address and replace it with your own version usingSetWindowLong
. Now messages to the window which you hooked should go via yourWindowProc
. Store replacedWindowProc
ptr to use withCallWindowProc
to do default stuff. Don't forget to replace back this ptr when your application exits!Nibu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com
-
TalSt wrote:
I would like to stop all messages to the window taskbar. I try to use the PreTranslateMessage function and it seems that the messages to the taskbar are not sending throw this function. Do you know a way to catch the messages?
Use
GetWindowLong
andGWL_WNDPROC
to get a window's main procedure address and replace it with your own version usingSetWindowLong
. Now messages to the window which you hooked should go via yourWindowProc
. Store replacedWindowProc
ptr to use withCallWindowProc
to do default stuff. Don't forget to replace back this ptr when your application exits!Nibu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com
-
Hello, Can you give more details? I am not sure I understand... How can the messages be stopped this way? Thanks :doh: !
TalSt wrote:
Can you give more details? I am not sure I understand... How can the messages be stopped this way?
An easier option if you are using MFC is
CWnd::SubclassWindow
. Something more on XXXWindowLong is here -> http://www.google.co.in/search?q=GetWindowLong+GWL_WNDPROc&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a[^] As you should be knowing thatWindowProc
is the main procedure through which a window receives messages, so hooking this procedure with your function will help you to filter messages.Nibu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com
-
Hello, I would like to stop all messages to the window taskbar. I try to use the PreTranslateMessage function and it seems that the messages to the taskbar are not sending throw this function. Do you know a way to catch the messages? Do you know if it should be throw this function? Thank a lot ;) !
I assume by "window taskbar" you mean the taskbar with the "Start" button on it. This is part of "Explorer.exe". You can't expect to recieve messages from windows in another process via "PreTranslateMessage"!
Steve