It seems that no one has encountered such a problem.
Yesterday, I resorted to patch the message processing
function so that it can accept the item selected by my
simulating message:
Code:
extern "C" __declspec(naked) void hook_tc(void)
{
__asm
{
test edi, edi // EDI=hMenuItem
jz is_it_treeview
do_nothing:
ret
is_it_treeview:
mov eax, [esi+20h] // EAX=current hWnd processing message
cmp eax, hTreeView
je is_it_retract
it_is_not_retract:
add dword ptr [esp], (0x2D57D - 0x2D4CE)
ret
is_it_retract:
call is_retract_selected
test eax, eax
jz it_is_not_retract
mov edi, hLstRetract // patch EDI
mov dword ptr [esp+0x24], 4 // patch flag=4=TVHT_ONITEMLABEL
ret
}
}
Though the problem is solved temporarily, but it's still a pity that
I cannot defeat that damn GetMessagePos().