IonicWind Software

Aurora Compiler => Coding Help - Aurora 101 => Topic started by: sapero on November 14, 2009, 03:20:11 PM

Title: Missing WM_LBUTTONUP in subclassed listview
Post by: sapero on November 14, 2009, 03:20:11 PM
Hello, I have a problem with subclassed listview. I want to implement a grid with custom drawn items and a dropdown button, reusing the list view control.
The list is filled with about 32 items, 10 subitems each row.
When I click an item, WM_LBUTTONUP is not comming, but if I click outside any item, WM_LBUTTONUP comes always. Any idea?
I think list view is entering a message loop to detect doubleclick, after receiving WM_LBUTTONDOWN. Returning zero in WM_LBUTTONDOWN solves this problem, but I need to change selection manually.

This is my code:
CEditFileTypes::OnInitDialog()
{
// init m_hwndProperties, insert items...
SetProp(m_hwndProperties, "CEditFileTypes", this);
m_PropListWndProc = SetWindowLong(m_hwndProperties, GWL_WNDPROC, &MyPropListWndProc);
}

sub MyPropListWndProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam),LRESULT
{
CEditFileTypes *edit = GetProp(hwnd, "CEditFileTypes");
RECT rc;
POINT pt;
LVHITTESTINFO hti;

switch (uMsg)
{
case WM_LBUTTONDOWN: // always received

case WM_LBUTTONUP: // not always received
MessageBeep(0);
case WM_DESTROY:
SetWindowLong(hwnd, GWL_WNDPROC, edit->m_PropListWndProc);
RemoveProp(hwnd, "CEditFileTypes");
}
return CallWindowProc(edit->m_PropListWndProc, hwnd, uMsg, wParam, lParam);
}


EDIT: I need to return 0 in WM_LBUTTONDOWN part.