From 9e66dc006edec187b7be9e62b3e2d15abfe86de4 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 21 Dec 2014 10:38:52 -0500 Subject: Added mouse tracking code. Not used yet. --- wintable/new/main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'wintable/new/main.c') diff --git a/wintable/new/main.c b/wintable/new/main.c index f3ffec8..316c760 100644 --- a/wintable/new/main.c +++ b/wintable/new/main.c @@ -53,6 +53,8 @@ static void (*tablePanic)(const char *, DWORD) = NULL; #define panic(...) (*tablePanic)(__VA_ARGS__, GetLastError()) #define abort $$$$ // prevent accidental use of abort() +static BOOL (*WINAPI tableTrackMouseEvent)(LPTRACKMOUSEEVENT); + struct table { HWND hwnd; HWND header; @@ -153,13 +155,17 @@ static void deftablePanic(const char *msg, DWORD lastError) DebugBreak(); } -void initTable(void (*panicfunc)(const char *msg, DWORD lastError)) +void initTable(void (*panicfunc)(const char *msg, DWORD lastError), BOOL (*WINAPI tme)(LPTRACKMOUSEEVENT)) { WNDCLASSW wc; tablePanic = panicfunc; if (tablePanic == NULL) tablePanic = deftablePanic; + if (tme == NULL) + // TODO errorless version + panic("must provide a TrackMouseEvent() to initTable()"); + tableTrackMouseEvent = tme; ZeroMemory(&wc, sizeof (WNDCLASSW)); wc.lpszClassName = tableWindowClass; wc.lpfnWndProc = tableWndProc; @@ -183,7 +189,7 @@ int main(int argc, char *argv[]) icc.dwICC = ICC_LISTVIEW_CLASSES; if (InitCommonControlsEx(&icc) == 0) panic("(test program) error initializing comctl32.dll"); - initTable(NULL); + initTable(NULL, _TrackMouseEvent); mainwin = CreateWindowExW(0, tableWindowClass, L"Main Window", WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL, -- cgit v1.2.3