When you say SendMessageW is failing do you mean the icon just isn't being applied (which is what I assume). What is the return value of the function call?
What I would like you to try is this:
js code:
function OnEvent_ChatWndCreated(pChatWnd) {
/*
Value Meaning
GA_PARENT(1) Retrieves the parent window. This does not include the owner, as it does with the GetParent function.
GA_ROOT(2) Retrieves the root window by walking the chain of parent windows.
GA_ROOTOWNER(3) Retrieves the owned root window by walking the chain of parent and owner windows returned by GetParent.
*/
var hWnd;
var MAX = 255;
for (var i=1;i<4;i++) {
hWnd = Interop.Call('user32', 'GetAncestor', pChatWnd.Handle, i);
var lpszClassName = Interop.Allocate(2*MAX+2);
Interop.Call('user32', 'GetClassNameW', hWnd, lpszClassName, lpszClassName.Size);
Debug.Trace('i :: '+i);
Debug.Trace(' pPlusWnd.Handle :: '+pChatWnd.Handle);
Debug.Trace(' hWnd :: '+hWnd);
Debug.Trace(' lpszClassName :: '+lpszClassName.ReadString(0));
lpszClassName.Size = 0;
}
}
Wondering if the Chat Window is still in a container. Running the code will tell us who the parent (if any) is.
Codes ugly I know