From 4f557f484c65e11f7ba35aa3aca8c72a6ad2a73e Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 7 Jan 2015 17:05:38 -0500 Subject: Added facilities for notifications. --- wintable/api.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'wintable/api.h') 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)); +} -- cgit v1.2.3