Mercurial > dwindows
changeset 200:446dd8cea477
Removed window parameter on Windows.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Mon, 20 Jan 2003 20:27:51 +0000 |
parents | b955228477b3 |
children | ae28c5f2fe0e |
files | win/dw.c |
diffstat | 1 files changed, 19 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/win/dw.c Mon Jan 20 20:21:06 2003 +0000 +++ b/win/dw.c Mon Jan 20 20:27:51 2003 +0000 @@ -2956,6 +2956,8 @@ while (GetMessage(&msg, NULL, 0, 0)) { + if(msg.hwnd == NULL && msg.message == WM_TIMER) + _wndproc(msg.hwnd, msg.message, msg.wParam, msg.lParam); TranslateMessage(&msg); DispatchMessage(&msg); } @@ -2976,6 +2978,8 @@ if(PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) { GetMessage(&msg, NULL, 0, 0); + if(msg.hwnd == NULL && msg.message == WM_TIMER) + _wndproc(msg.hwnd, msg.message, msg.wParam, msg.lParam); TranslateMessage(&msg); DispatchMessage(&msg); } @@ -3041,6 +3045,8 @@ while (GetMessage(&msg,NULL,0,0)) { + if(msg.hwnd == NULL && msg.message == WM_TIMER) + _wndproc(msg.hwnd, msg.message, msg.wParam, msg.lParam); TranslateMessage(&msg); DispatchMessage(&msg); if(dialog->done) @@ -7389,19 +7395,17 @@ * Returns: * Timer ID for use with dw_timer_disconnect(), 0 on error. */ -int API dw_timer_connect(HWND window, int interval, void *sigfunc, void *data) -{ - static int timerid = 0; - - if(window && sigfunc) - { - timerid++; - - if(timerid < 1) - timerid = 1; - - _new_signal(WM_TIMER, window, timerid, sigfunc, data); - return SetTimer(window, timerid, interval, NULL); +int API dw_timer_connect(int interval, void *sigfunc, void *data) +{ + if(sigfunc) + { + int timerid = SetTimer(NULL, 0, interval, NULL); + + if(timerid) + { + _new_signal(WM_TIMER, NULL, timerid, sigfunc, data); + return timerid; + } } return 0; } @@ -7419,11 +7423,12 @@ if(!id) return; + KillTimer(NULL, id); + while(tmp) { if(tmp->id == id) { - KillTimer(tmp->window, id); if(prev) { prev->next = tmp->next;