I have setup a hook on WM_SETTEXT message using WH_CALLWNDPROC.
In hook procedure
CWPSTRUCT* info = (CWPSTRUCT*) lParam;
wchar_t *wsz = NULL;
switch(info->message)
{
case WM_SETTEXT:
wsz = (wchar_t *) info->lParam;
//info->lParam = (LPARAM) L"Hello";
//SendMessage(info->hWnd,WM_SETTEXT,0,(LPARAM)L"HEllo");
//SetWindowText(info->hWnd,L"Hello");
break;
}
Is it possible to change the string as done above in the code. I tried by using APIs like
SendMessage(info->hWnd,WM_SETTEXT,0,(LPARAM)L"HEllo");
SetWindowText(info->hWnd,L"Hello");
But none of them working.Idea here is to hook WM_SETTEXT message and change the string before it reached destination window.