I can't seem to get LVM_HITTEST to work, it always returns -1. Does anyone have a working example? Thanks Martin
Posted on 2000-12-25 17:06:00 by martin
Hi martin, here is a code snippet. .data? ; - _LV_HITTESTINFO structure - LVH_ptx dd ? ;xpos, POINT structure LVH_pty dd ? ;ypos, pos. to hit test, client coord. LVH_flags dd ? ;variable receives result of a hit test LVH_iItem dd ? ;receives index of the matching item .code mov LVH_ptx,10h ;fill LV_HITTESTINFO structure,xpos to test mov LVH_pty,30h ;fill LV_HITTESTINFO structure,ypos to test ;client coordinates, ListView window !!! ;------------------------------------------------------------------------------ ; API "SendMessageA" sends a message to the specified window ;------------------------------------------------------------------------------ push OFFSET LVH_ptx ;lParam, pcol, pointer LV_HITTESTINFO struc push 0h ;wParam, set to 0 push 1012h ;uMsg, LVM_FIRST=1000h | LVM_HITTEST=18 push hWnd_ListView ;hwnd, handle of destination window call SendMessageA ;- API Function - cmp eax,-1 ;error ? je My_Error ;if no error eax contains the item index ;your code here My_Error: ;your error routine here so long Test
Posted on 2000-12-26 04:58:00 by Test Department