diff options
| author | Pietro Gagliardi <[email protected]> | 2014-12-21 10:38:52 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-12-21 10:38:52 -0500 |
| commit | 9e66dc006edec187b7be9e62b3e2d15abfe86de4 (patch) | |
| tree | 9c1471bb23309bd834bf39929d7014e7fcb8ed90 /wintable/new/main.c | |
| parent | 0c216088531dc7a8b400cd93911bd031ff987107 (diff) | |
Added mouse tracking code. Not used yet.
Diffstat (limited to 'wintable/new/main.c')
| -rw-r--r-- | wintable/new/main.c | 10 |
1 files changed, 8 insertions, 2 deletions
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, |
