View Single Post
  #2  
Old 02-10-2015, 15:42
BlackWhite BlackWhite is offline
Friend
 
Join Date: Apr 2013
Posts: 85
Rept. Given: 4
Rept. Rcvd 14 Times in 6 Posts
Thanks Given: 14
Thanks Rcvd at 56 Times in 25 Posts
BlackWhite Reputation: 14
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().
Reply With Quote