]>
Commit | Line | Data |
---|---|---|
0fd734af JS |
1 | *** /home/julians/microwindows/original/microwin/src/mwin/winuser.c Wed Jul 5 00:36:42 2000 |
2 | --- winuser.c Tue May 22 00:42:01 2001 | |
3 | *************** | |
4 | *** 136,150 **** | |
5 | return FALSE; | |
6 | } | |
7 | ||
8 | BOOL WINAPI | |
9 | ! PeekMessage(LPMSG lpMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, | |
10 | ! UINT wRemoveMsg) | |
11 | { | |
12 | HWND wp; | |
13 | PMSG pNxtMsg; | |
14 | ||
15 | /* check if no messages in queue*/ | |
16 | if(mwMsgHead.head == NULL) { | |
17 | #if PAINTONCE | |
18 | /* check all windows for pending paint messages*/ | |
19 | for(wp=listwp; wp; wp=wp->next) { | |
20 | --- 136,158 ---- | |
21 | return FALSE; | |
22 | } | |
23 | ||
24 | + /* | |
25 | + * A helper function for sharing code between PeekMessage and GetMessage | |
26 | + */ | |
27 | + | |
28 | BOOL WINAPI | |
29 | ! PeekMessageHelper(LPMSG lpMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, | |
30 | ! UINT wRemoveMsg, BOOL returnIfEmptyQueue) | |
31 | { | |
32 | HWND wp; | |
33 | PMSG pNxtMsg; | |
34 | ||
35 | /* check if no messages in queue*/ | |
36 | if(mwMsgHead.head == NULL) { | |
37 | + /* Added by JACS so it doesn't reach MwSelect */ | |
38 | + if (returnIfEmptyQueue) | |
39 | + return FALSE; | |
40 | + | |
41 | #if PAINTONCE | |
42 | /* check all windows for pending paint messages*/ | |
43 | for(wp=listwp; wp; wp=wp->next) { | |
44 | *************** | |
45 | *** 176,188 **** | |
46 | } | |
47 | ||
48 | BOOL WINAPI | |
49 | GetMessage(LPMSG lpMsg,HWND hwnd,UINT wMsgFilterMin,UINT wMsgFilterMax) | |
50 | { | |
51 | /* | |
52 | * currently MwSelect() must poll for VT switch reasons, | |
53 | * so this code will work | |
54 | */ | |
55 | ! while(!PeekMessage(lpMsg, hwnd, wMsgFilterMin, wMsgFilterMax,PM_REMOVE)) | |
56 | continue; | |
57 | return lpMsg->message != WM_QUIT; | |
58 | } | |
59 | --- 184,205 ---- | |
60 | } | |
61 | ||
62 | BOOL WINAPI | |
63 | + PeekMessage(LPMSG lpMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, | |
64 | + UINT wRemoveMsg) | |
65 | + { | |
66 | + /* Never wait in MwSelect: pass TRUE */ | |
67 | + return PeekMessageHelper(lpMsg, hwnd, uMsgFilterMin, uMsgFilterMax, wRemoveMsg, TRUE); | |
68 | + } | |
69 | + | |
70 | + BOOL WINAPI | |
71 | GetMessage(LPMSG lpMsg,HWND hwnd,UINT wMsgFilterMin,UINT wMsgFilterMax) | |
72 | { | |
73 | /* | |
74 | * currently MwSelect() must poll for VT switch reasons, | |
75 | * so this code will work | |
76 | */ | |
77 | ! /* Always wait in MwSelect if there are messages: pass FALSE */ | |
78 | ! while(!PeekMessageHelper(lpMsg, hwnd, wMsgFilterMin, wMsgFilterMax,PM_REMOVE, FALSE)) | |
79 | continue; | |
80 | return lpMsg->message != WM_QUIT; | |
81 | } |