summaryrefslogtreecommitdiff
path: root/wintable/api.h
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-01-07 17:05:38 -0500
committerPietro Gagliardi <[email protected]>2015-01-07 17:05:38 -0500
commit4f557f484c65e11f7ba35aa3aca8c72a6ad2a73e (patch)
treee8667618007ed782cf29e76683f03ac2cb5b475b /wintable/api.h
parent3b81ebab986d619742fffc052d4fca6a8c5080fd (diff)
Added facilities for notifications.
Diffstat (limited to 'wintable/api.h')
-rw-r--r--wintable/api.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/wintable/api.h b/wintable/api.h
index 7ec9afc..fb0e1c0 100644
--- a/wintable/api.h
+++ b/wintable/api.h
@@ -33,3 +33,20 @@ HANDLER(apiHandlers)
}
return FALSE;
}
+
+static LRESULT notify(struct table *t, UINT code, intptr_t row, intptr_t column, uintptr_t data)
+{
+ tableNM nm;
+
+ ZeroMemory(&nm, sizeof (tableNM));
+ nm.nmhdr.hwndFrom = t->hwnd;
+ // TODO check for error from here? 0 is a valid ID (IDCANCEL)
+ nm.nmhdr.idFrom = GetDlgCtrlID(t->hwnd);
+ nm.nmhdr.code = code;
+ nm.row = row;
+ nm.column = column;
+ nm.columnType = t->columnTypes[nm.column];
+ nm.data = data;
+ // TODO check for error from GetParent()?
+ return SendMessageW(GetParent(t->hwnd), WM_NOTIFY, (WPARAM) (nm.nmhdr.idFrom), (LPARAM) (&nm));
+}