SendMessage를 이용하여 ListBox Item 선택하기.



procedure SelectListboxItem(hListBox: HWND; ItemIndex: Integer);
var rt: TRect;
begin
  if hListbox=0 then Exit;

  SendMessage(hListBox, LB_SETCURSEL, ItemIndex, 0);
  SendMessage(hListBox, LB_GETITEMRECT, ItemIndex, Integer(@rt));
  SendMessage(hListBox, WM_LBUTTONDOWN, 0, MakeLParam(1, rt.Top+1));
  SendMessage(hListBox, WM_LBUTTONUP, 0, MakeLParam(1, rt.Top+1));
end;






Posted by bloodguy
,