Mercurial > dwindows
comparison win/dw.c @ 150:2a0d7b57a6da
Removed unnecessary parameters from dw_main().
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 24 Oct 2002 15:53:27 +0000 |
parents | b479002e013f |
children | 656de0c52c56 |
comparison
equal
deleted
inserted
replaced
149:6028f787f7c8 | 150:2a0d7b57a6da |
---|---|
15 #include <string.h> | 15 #include <string.h> |
16 #include <stdio.h> | 16 #include <stdio.h> |
17 #include <process.h> | 17 #include <process.h> |
18 #include <time.h> | 18 #include <time.h> |
19 #include "dw.h" | 19 #include "dw.h" |
20 | |
21 /* this is the callback handle for the window procedure */ | |
22 /* make sure you always match the calling convention! */ | |
23 int (*filterfunc)(HWND, UINT, WPARAM, LPARAM) = 0L; | |
24 | 20 |
25 HWND popup = (HWND)NULL, hwndBubble = (HWND)NULL, hwndBubbleLast, DW_HWND_OBJECT = (HWND)NULL; | 21 HWND popup = (HWND)NULL, hwndBubble = (HWND)NULL, hwndBubbleLast, DW_HWND_OBJECT = (HWND)NULL; |
26 | 22 |
27 HINSTANCE DWInstance = NULL; | 23 HINSTANCE DWInstance = NULL; |
28 | 24 |
1182 msg = WM_LBUTTONDOWN; | 1178 msg = WM_LBUTTONDOWN; |
1183 if(msg == WM_RBUTTONUP || msg == WM_MBUTTONUP) | 1179 if(msg == WM_RBUTTONUP || msg == WM_MBUTTONUP) |
1184 msg = WM_LBUTTONUP; | 1180 msg = WM_LBUTTONUP; |
1185 if(msg == WM_HSCROLL) | 1181 if(msg == WM_HSCROLL) |
1186 msg = WM_VSCROLL; | 1182 msg = WM_VSCROLL; |
1187 | |
1188 if(filterfunc) | |
1189 result = filterfunc(hWnd, msg, mp1, mp2); | |
1190 | 1183 |
1191 if(result == -1) | 1184 if(result == -1) |
1192 { | 1185 { |
1193 /* Avoid infinite recursion */ | 1186 /* Avoid infinite recursion */ |
1194 command_active = 1; | 1187 command_active = 1; |
2780 return 0; | 2773 return 0; |
2781 } | 2774 } |
2782 | 2775 |
2783 /* | 2776 /* |
2784 * Runs a message loop for Dynamic Windows. | 2777 * Runs a message loop for Dynamic Windows. |
2785 * Parameters: | 2778 */ |
2786 * currenthab: The handle to the current anchor block | 2779 void dw_main(void) |
2787 * or NULL if this DW is handling the message loop. | |
2788 * func: Function pointer to the message filter function. | |
2789 */ | |
2790 void dw_main(HAB currenthab, void *func) | |
2791 { | 2780 { |
2792 MSG msg; | 2781 MSG msg; |
2793 | |
2794 /* Setup the filter function */ | |
2795 filterfunc = func; | |
2796 | 2782 |
2797 _dwtid = dw_thread_id(); | 2783 _dwtid = dw_thread_id(); |
2798 | 2784 |
2799 while (GetMessage(&msg, NULL, 0, 0)) | 2785 while (GetMessage(&msg, NULL, 0, 0)) |
2800 { | 2786 { |