From 3b380ea07fea564059aa1c6ecc97c6c923a9cb4e Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 20 Aug 2014 20:50:55 -0400 Subject: [PATCH] Added code to try to figure out the bheavior of WIndows Tables for adding an OnSelected() event. --- redo/table_windows.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/redo/table_windows.c b/redo/table_windows.c index 6f0faae..a8bbfa3 100644 --- a/redo/table_windows.c +++ b/redo/table_windows.c @@ -25,6 +25,35 @@ static void handle(HWND hwnd, WPARAM wParam, LPARAM lParam, void (*handler)(void (*handler)(data, ht.iItem, ht.iSubItem); } +static struct {int code; char *name;} lvnnames[] = { +{ LVN_ITEMCHANGING, "LVN_ITEMCHANGING" }, +{ LVN_ITEMCHANGED, "LVN_ITEMCHANGED" }, +{ LVN_INSERTITEM, "LVN_INSERTITEM" }, +{ LVN_DELETEITEM, "LVN_DELETEITEM" }, +{ LVN_DELETEALLITEMS, "LVN_DELETEALLITEMS" }, +{ LVN_BEGINLABELEDITA, "LVN_BEGINLABELEDITA" }, +{ LVN_BEGINLABELEDITW, "LVN_BEGINLABELEDITW" }, +{ LVN_ENDLABELEDITA, "LVN_ENDLABELEDITA" }, +{ LVN_ENDLABELEDITW, "LVN_ENDLABELEDITW" }, +{ LVN_COLUMNCLICK, "LVN_COLUMNCLICK" }, +{ LVN_BEGINDRAG, "LVN_BEGINDRAG" }, +{ LVN_BEGINRDRAG, "LVN_BEGINRDRAG" }, +//{ LVN_ODCACHEHINT, "LVN_ODCACHEHINT" }, +{ LVN_ODFINDITEMA, "LVN_ODFINDITEMA" }, +{ LVN_ODFINDITEMW, "LVN_ODFINDITEMW" }, +{ LVN_ITEMACTIVATE, "LVN_ITEMACTIVATE" }, +{ LVN_ODSTATECHANGED, "LVN_ODSTATECHANGED" }, +{ LVN_SETDISPINFOA, "LVN_SETDISPINFOA" }, +{ LVN_SETDISPINFOW, "LVN_SETDISPINFOW" }, +//{ LVN_KEYDOWN, "LVN_KEYDOWN" }, +{ LVN_MARQUEEBEGIN, "LVN_MARQUEEBEGIN" }, +{ LVN_GETINFOTIPA, "LVN_GETINFOTIPA" }, +{ LVN_GETINFOTIPW, "LVN_GETINFOTIPW" }, +{ LVN_BEGINSCROLL, "LVN_BEGINSCROLL" }, +{ LVN_ENDSCROLL, "LVN_ENDSCROLL" }, +{ 0, NULL }, +}; + static LRESULT CALLBACK tableSubProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR id, DWORD_PTR data) { NMHDR *nmhdr = (NMHDR *) lParam; @@ -37,6 +66,7 @@ static LRESULT CALLBACK tableSubProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM tableGetCell((void *) data, &(fill->item)); return 0; } +for(int i=0;lvnnames[i].code!=0;i++)if(lvnnames[i].code==nmhdr->code)printf("%s\n",lvnnames[i].name); return (*fv_DefSubclassProc)(hwnd, uMsg, wParam, lParam); case WM_MOUSEMOVE: handle(hwnd, wParam, lParam, tableSetHot, (void *) data);