Hi everyone!
I am trying to write lib for windows application GUI testing.The problem
that I see now it is how to call SendMessage WinAPI for tree control to
get tree item rect.Code Commctrl.h for this looks like:
#define TVM_GETITEMRECT (TV_FIRST + 4)
#define TreeView_GetItemRect(hwnd, hitem, prc, code)
(*(HTREEITEM *)prc = (hitem), (BOOL)SNDMSG((hwnd), TVM_GETITEMRECT,
(WPARAM)(code), (LPARAM)(RECT *)(prc)))
And I don’t know what is *(HTREEITEM *)prc = (hitem) and how to do this
on Ruby.
For example my Ruby code for GetRoot looks like:
def send_message(hwnd,msg,wParam,lParam )
send_message = user32 ‘SendMessage’ , [‘L’ , ‘L’ , ‘L’ , ‘P’ ], ‘L’
send_message.call hwnd, msg, wParam, lParam
end
def get_tree_root_item(htree)
send_message(htree,0x1100+10,TVGN_ROOT,0 )
end
and this works for me.
Commctrl.h for this looks:
#define TreeView_GetRoot(hwnd) TreeView_GetNextItem(hwnd, NULL,
TVGN_ROOT)
#define TVM_GETNEXTITEM (TV_FIRST + 10)
#define TreeView_GetNextItem(hwnd, hitem, code)
(HTREEITEM)SNDMSG((hwnd), TVM_GETNEXTITEM, (WPARAM)(code),
(LPARAM)(HTREEITEM)(hitem))
It would be greate if someone can explain what is *(HTREEITEM *)prc =
(hitem) and how to do this in Ruby.
Thanks,
Maxim