Taskbar is hooked
-
I have hooked taskbar. Below code is the new window procedure for task bar. But when I tried to send message with valid m_hDlgWnd of my application window. But it is not working.:confused: Is it not possible to send message from this task bar window procedure?
LRESULT CALLBACK NewProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
)
{
switch (uMsg)
{
case WM_PAINT:
::SendMessage( m_hDlgWnd, WM_TASKBAR_UPDATED_EVENT,0,0 );// NOT WORKING
::SetEvent( m_hTaskBarUpdatedEvent ); // NOT WORKING
::MessageBeep( MB_OK );
break;
}return CallWindowProc( OldProc,hwnd,uMsg,wParam,lParam );
}
-Cvaji
-
I have hooked taskbar. Below code is the new window procedure for task bar. But when I tried to send message with valid m_hDlgWnd of my application window. But it is not working.:confused: Is it not possible to send message from this task bar window procedure?
LRESULT CALLBACK NewProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
)
{
switch (uMsg)
{
case WM_PAINT:
::SendMessage( m_hDlgWnd, WM_TASKBAR_UPDATED_EVENT,0,0 );// NOT WORKING
::SetEvent( m_hTaskBarUpdatedEvent ); // NOT WORKING
::MessageBeep( MB_OK );
break;
}return CallWindowProc( OldProc,hwnd,uMsg,wParam,lParam );
}
-Cvaji
-
After finding the window again, it is worked. :)
case WM_PAINT:
{
m_hDlgWnd = ::FindWindow( NULL, "HackTaskBar" );
::SendMessage( m_hDlgWnd, WM_TASKBAR_UPDATED_EVENT,0,0 );// WORKING
::MessageBeep( MB_OK );
break;
}Just be carefull with SendMessage, you can run into deadlocks (i'm not saying you will), if the timing isn't that important for what you need, i recommend using PostMessage instead... [edit] I mean if you use SendMessage between different threads/processes...
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Sometimes you just have to hate coding to do it well. <
modified on Tuesday, March 30, 2010 12:05 PM
-
Just be carefull with SendMessage, you can run into deadlocks (i'm not saying you will), if the timing isn't that important for what you need, i recommend using PostMessage instead... [edit] I mean if you use SendMessage between different threads/processes...
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > Sometimes you just have to hate coding to do it well. <
modified on Tuesday, March 30, 2010 12:05 PM