1 | /* $Id: windowmsg.cpp,v 1.1 1999-07-14 08:35:37 sandervl Exp $ */
|
---|
2 | /*
|
---|
3 | * Win32 window message APIs for OS/2
|
---|
4 | *
|
---|
5 | * Copyright 1999 Sander van Leeuwen
|
---|
6 | *
|
---|
7 | *
|
---|
8 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
9 | *
|
---|
10 | */
|
---|
11 | #include <os2win.h>
|
---|
12 | #include <misc.h>
|
---|
13 |
|
---|
14 |
|
---|
15 | //******************************************************************************
|
---|
16 | //******************************************************************************
|
---|
17 | LONG WIN32API SendDlgItemMessageA( HWND arg1, int arg2, UINT arg3, WPARAM arg4, LPARAM arg5)
|
---|
18 | {
|
---|
19 | #ifdef DEBUG
|
---|
20 | WriteLog("USER32: SendDlgItemMessageA\n");
|
---|
21 | #endif
|
---|
22 | return O32_SendDlgItemMessage(arg1, arg2, arg3, arg4, arg5);
|
---|
23 | }
|
---|
24 | //******************************************************************************
|
---|
25 | //******************************************************************************
|
---|
26 | LONG WIN32API SendDlgItemMessageW( HWND arg1, int arg2, UINT arg3, WPARAM arg4, LPARAM arg5)
|
---|
27 | {
|
---|
28 | #ifdef DEBUG
|
---|
29 | WriteLog("USER32: SendDlgItemMessageW\n");
|
---|
30 | #endif
|
---|
31 | return O32_SendDlgItemMessage(arg1, arg2, arg3, arg4, arg5);
|
---|
32 | }
|
---|
33 | //******************************************************************************
|
---|
34 | //******************************************************************************
|
---|
35 | VOID WIN32API PostQuitMessage( int nExitCode)
|
---|
36 | {
|
---|
37 | dprintf(("USER32: PostQuitMessage\n"));
|
---|
38 |
|
---|
39 | O32_PostQuitMessage(arg1);
|
---|
40 | }
|
---|
41 | //******************************************************************************
|
---|
42 | //******************************************************************************
|
---|
43 | LONG WIN32API DispatchMessageA( const MSG * arg1)
|
---|
44 | {
|
---|
45 | //// dprintf(("USER32: DispatchMessage\n"));
|
---|
46 | return O32_DispatchMessage(arg1);
|
---|
47 | }
|
---|
48 | //******************************************************************************
|
---|
49 | //******************************************************************************
|
---|
50 | LONG WIN32API DispatchMessageW( const MSG * arg1)
|
---|
51 | {
|
---|
52 | #ifdef DEBUG
|
---|
53 | WriteLog("USER32: DispatchMessageW\n");
|
---|
54 | #endif
|
---|
55 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
56 | return O32_DispatchMessage(arg1);
|
---|
57 | }
|
---|
58 | //******************************************************************************
|
---|
59 | //******************************************************************************
|
---|
60 | BOOL WIN32API TranslateMessage( const MSG * arg1)
|
---|
61 | {
|
---|
62 | #ifdef DEBUG
|
---|
63 | //// WriteLog("USER32: TranslateMessage\n");
|
---|
64 | #endif
|
---|
65 | return O32_TranslateMessage(arg1);
|
---|
66 | }
|
---|
67 | //******************************************************************************
|
---|
68 | //******************************************************************************
|
---|
69 | LRESULT WIN32API SendMessageA(HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4)
|
---|
70 | {
|
---|
71 | LRESULT rc;
|
---|
72 |
|
---|
73 | #ifdef DEBUG1
|
---|
74 | WriteLog("USER32: SendMessage....\n");
|
---|
75 | #endif
|
---|
76 | rc = O32_SendMessage(arg1, arg2, arg3, arg4);
|
---|
77 | #ifdef DEBUG1
|
---|
78 | WriteLog("USER32: *****SendMessage %X %X %X %X returned %d\n", arg1, arg2, arg3, arg4, rc);
|
---|
79 | #endif
|
---|
80 | return(rc);
|
---|
81 | }
|
---|
82 | //******************************************************************************
|
---|
83 | //******************************************************************************
|
---|
84 | LRESULT WIN32API SendMessageW( HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4)
|
---|
85 | {
|
---|
86 | LRESULT rc;
|
---|
87 |
|
---|
88 | #ifdef DEBUG
|
---|
89 | WriteLog("USER32: SendMessageW....\n");
|
---|
90 | #endif
|
---|
91 | rc = O32_SendMessage(arg1, arg2, arg3, arg4);
|
---|
92 | #ifdef DEBUG
|
---|
93 | WriteLog("USER32: SendMessageW %X %X %X %X returned %d\n", arg1, arg2, arg3, arg4, rc);
|
---|
94 | #endif
|
---|
95 | return(rc);
|
---|
96 | }
|
---|
97 | //******************************************************************************
|
---|
98 | //******************************************************************************
|
---|
99 | BOOL WIN32API IsDialogMessageA( HWND arg1, LPMSG arg2)
|
---|
100 | {
|
---|
101 | #ifdef DEBUG
|
---|
102 | //// WriteLog("USER32: IsDialogMessage\n");
|
---|
103 | #endif
|
---|
104 | return O32_IsDialogMessage(arg1, arg2);
|
---|
105 | }
|
---|
106 | //******************************************************************************
|
---|
107 | //******************************************************************************
|
---|
108 | BOOL WIN32API PostMessageA( HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4)
|
---|
109 | {
|
---|
110 | #ifdef DEBUG
|
---|
111 | WriteLog("USER32: PostMessageA %X %X %X %X\n", arg1, arg2, arg3, arg4);
|
---|
112 | #endif
|
---|
113 | return O32_PostMessage(arg1, arg2, arg3, arg4);
|
---|
114 | }
|
---|
115 | //******************************************************************************
|
---|
116 | //******************************************************************************
|
---|
117 | BOOL WIN32API WaitMessage(void)
|
---|
118 | {
|
---|
119 | #ifdef DEBUG
|
---|
120 | WriteLog("USER32: WaitMessage\n");
|
---|
121 | #endif
|
---|
122 | return O32_WaitMessage();
|
---|
123 | }
|
---|
124 | //******************************************************************************
|
---|
125 | //******************************************************************************
|
---|
126 | BOOL WIN32API PeekMessageA(LPMSG arg1, HWND arg2, UINT arg3, UINT arg4, UINT arg5)
|
---|
127 | {
|
---|
128 | #ifdef DEBUG
|
---|
129 | // WriteLog("USER32: PeekMessage\n");
|
---|
130 | #endif
|
---|
131 | return O32_PeekMessage(arg1, arg2, arg3, arg4, arg5);
|
---|
132 | }
|
---|
133 | //******************************************************************************
|
---|
134 | //******************************************************************************
|
---|
135 | BOOL WIN32API PeekMessageW( LPMSG arg1, HWND arg2, UINT arg3, UINT arg4, UINT arg5)
|
---|
136 | {
|
---|
137 | #ifdef DEBUG
|
---|
138 | WriteLog("USER32: PeekMessageW\n");
|
---|
139 | #endif
|
---|
140 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
141 | return O32_PeekMessage(arg1, arg2, arg3, arg4, arg5);
|
---|
142 | }
|
---|
143 | //******************************************************************************
|
---|
144 | //******************************************************************************
|
---|
145 | // NOTE: Open32 function doesn't have the 'W'.
|
---|
146 | BOOL WIN32API PostMessageW( HWND arg1, UINT arg2, WPARAM arg3, LPARAM arg4)
|
---|
147 | {
|
---|
148 | #ifdef DEBUG
|
---|
149 | WriteLog("USER32: PostMessageW\n");
|
---|
150 | #endif
|
---|
151 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
152 | return O32_PostMessage(arg1, arg2, arg3, arg4);
|
---|
153 | }
|
---|
154 | //******************************************************************************
|
---|
155 | //******************************************************************************
|
---|
156 | BOOL WIN32API InSendMessage(void)
|
---|
157 | {
|
---|
158 | #ifdef DEBUG
|
---|
159 | WriteLog("USER32: InSendMessage\n");
|
---|
160 | #endif
|
---|
161 | return O32_InSendMessage();
|
---|
162 | }
|
---|
163 | //******************************************************************************
|
---|
164 | //******************************************************************************
|
---|
165 | BOOL WIN32API IsDialogMessageW( HWND arg1, LPMSG arg2)
|
---|
166 | {
|
---|
167 | #ifdef DEBUG
|
---|
168 | WriteLog("USER32: IsDialogMessageW\n");
|
---|
169 | #endif
|
---|
170 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
171 | return O32_IsDialogMessage(arg1, arg2);
|
---|
172 | }
|
---|
173 | //******************************************************************************
|
---|
174 | //******************************************************************************
|
---|
175 | BOOL WIN32API ReplyMessage( LRESULT arg1)
|
---|
176 | {
|
---|
177 | #ifdef DEBUG
|
---|
178 | WriteLog("USER32: ReplyMessage\n");
|
---|
179 | #endif
|
---|
180 | return O32_ReplyMessage(arg1);
|
---|
181 | }
|
---|
182 | //******************************************************************************
|
---|
183 | //******************************************************************************
|
---|
184 | BOOL WIN32API PostThreadMessageA( DWORD arg1, UINT arg2, WPARAM arg3, LPARAM arg4)
|
---|
185 | {
|
---|
186 | #ifdef DEBUG
|
---|
187 | WriteLog("USER32: PostThreadMessageA\n");
|
---|
188 | #endif
|
---|
189 | return O32_PostThreadMessage(arg1, arg2, arg3, arg4);
|
---|
190 | }
|
---|
191 | //******************************************************************************
|
---|
192 | //******************************************************************************
|
---|
193 | BOOL WIN32API PostThreadMessageW( DWORD arg1, UINT arg2, WPARAM arg3, LPARAM arg4)
|
---|
194 | {
|
---|
195 | #ifdef DEBUG
|
---|
196 | WriteLog("USER32: PostThreadMessageW\n");
|
---|
197 | #endif
|
---|
198 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
199 | return O32_PostThreadMessage(arg1, arg2, arg3, arg4);
|
---|
200 | }
|
---|
201 | //******************************************************************************
|
---|
202 | //SvL: 24-6-'97 - Added
|
---|
203 | //******************************************************************************
|
---|
204 | UINT WIN32API RegisterWindowMessageA(LPCSTR arg1)
|
---|
205 | {
|
---|
206 | UINT rc;
|
---|
207 |
|
---|
208 | rc = O32_RegisterWindowMessage(arg1);
|
---|
209 | #ifdef DEBUG
|
---|
210 | WriteLog("USER32: RegisterWindowMessageA %s returned %X\n", arg1, rc);
|
---|
211 | #endif
|
---|
212 | return(rc);
|
---|
213 | }
|
---|
214 | //******************************************************************************
|
---|
215 | //******************************************************************************
|
---|
216 | UINT WIN32API RegisterWindowMessageW( LPCWSTR arg1)
|
---|
217 | {
|
---|
218 | char *astring = UnicodeToAsciiString((LPWSTR)arg1);
|
---|
219 | UINT rc;
|
---|
220 |
|
---|
221 | #ifdef DEBUG
|
---|
222 | WriteLog("USER32: RegisterWindowMessageW\n");
|
---|
223 | #endif
|
---|
224 | rc = O32_RegisterWindowMessage(astring);
|
---|
225 | FreeAsciiString(astring);
|
---|
226 | return rc;
|
---|
227 | }
|
---|
228 | //******************************************************************************
|
---|
229 | //******************************************************************************
|
---|
230 | BOOL WIN32API CallMsgFilterA( LPMSG arg1, int arg2)
|
---|
231 | {
|
---|
232 | #ifdef DEBUG
|
---|
233 | WriteLog("USER32: CallMsgFilterA\n");
|
---|
234 | #endif
|
---|
235 | return O32_CallMsgFilter(arg1, arg2);
|
---|
236 | }
|
---|
237 | //******************************************************************************
|
---|
238 | //******************************************************************************
|
---|
239 | BOOL WIN32API CallMsgFilterW( LPMSG arg1, int arg2)
|
---|
240 | {
|
---|
241 | #ifdef DEBUG
|
---|
242 | WriteLog("USER32: CallMsgFilterW\n");
|
---|
243 | #endif
|
---|
244 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
245 | return O32_CallMsgFilter(arg1, arg2);
|
---|
246 | }
|
---|
247 | //******************************************************************************
|
---|
248 | //******************************************************************************
|
---|
249 | LRESULT WIN32API CallWindowProcA(WNDPROC wndprcPrev,
|
---|
250 | HWND arg2,
|
---|
251 | UINT arg3,
|
---|
252 | WPARAM arg4,
|
---|
253 | LPARAM arg5)
|
---|
254 | {
|
---|
255 | #ifdef DEBUG
|
---|
256 | //// WriteLog("USER32: CallWindowProcA %X hwnd=%X, msg = %X\n", wndprcPrev, arg2, arg3);
|
---|
257 | #endif
|
---|
258 |
|
---|
259 | return wndprcPrev(arg2, arg3, arg4, arg5); //win32 callback (__stdcall)
|
---|
260 | }
|
---|
261 | //******************************************************************************
|
---|
262 | //******************************************************************************
|
---|
263 | LRESULT WIN32API CallWindowProcW(WNDPROC arg1,
|
---|
264 | HWND arg2,
|
---|
265 | UINT arg3,
|
---|
266 | WPARAM arg4,
|
---|
267 | LPARAM arg5)
|
---|
268 | {
|
---|
269 | dprintf(("USER32: CallWindowProcW(%08xh,%08xh,%08xh,%08xh,%08xh) not properly implemented.\n",
|
---|
270 | arg1,
|
---|
271 | arg2,
|
---|
272 | arg3,
|
---|
273 | arg4,
|
---|
274 | arg5));
|
---|
275 |
|
---|
276 | return CallWindowProcA(arg1,
|
---|
277 | arg2,
|
---|
278 | arg3,
|
---|
279 | arg4,
|
---|
280 | arg5);
|
---|
281 | }
|
---|
282 | //******************************************************************************
|
---|
283 | //No need to support this
|
---|
284 | //******************************************************************************
|
---|
285 | BOOL WIN32API SetMessageQueue(int cMessagesMax)
|
---|
286 | {
|
---|
287 | #ifdef DEBUG
|
---|
288 | WriteLog("USER32: SetMessageQueue\n");
|
---|
289 | #endif
|
---|
290 | return(TRUE);
|
---|
291 | }
|
---|
292 | //******************************************************************************
|
---|
293 | //******************************************************************************
|
---|
294 | LRESULT WIN32API SendMessageTimeoutA(HWND hwnd, UINT Msg, WPARAM wParam,
|
---|
295 | LPARAM lParam, UINT fuFlags, UINT uTimeOut,
|
---|
296 | LPDWORD lpdwResult)
|
---|
297 | {
|
---|
298 | #ifdef DEBUG
|
---|
299 | WriteLog("USER32: SendMessageTimeoutA, partially implemented\n");
|
---|
300 | #endif
|
---|
301 | //ignore fuFlags & wTimeOut
|
---|
302 | *lpdwResult = SendMessageA(hwnd, Msg, wParam, lParam);
|
---|
303 | return(TRUE);
|
---|
304 | }
|
---|
305 | //******************************************************************************
|
---|
306 | //******************************************************************************
|
---|
307 | LRESULT WIN32API SendMessageTimeoutW(HWND hwnd, UINT Msg, WPARAM wParam,
|
---|
308 | LPARAM lParam, UINT fuFlags, UINT uTimeOut,
|
---|
309 | LPDWORD lpdwResult)
|
---|
310 | {
|
---|
311 | #ifdef DEBUG
|
---|
312 | WriteLog("USER32: SendMessageTimeoutW, partially implemented\n");
|
---|
313 | #endif
|
---|
314 | return(SendMessageTimeoutA(hwnd, Msg, wParam, lParam, fuFlags, uTimeOut, lpdwResult));
|
---|
315 | }
|
---|
316 | //******************************************************************************
|
---|
317 | //******************************************************************************
|
---|
318 | BOOL WIN32API SendNotifyMessageA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
---|
319 | {
|
---|
320 | #ifdef DEBUG
|
---|
321 | WriteLog("USER32: SendNotifyMessageA, not completely implemented\n");
|
---|
322 | #endif
|
---|
323 | return(SendMessageA(hwnd, Msg, wParam, lParam));
|
---|
324 | }
|
---|
325 | //******************************************************************************
|
---|
326 | //******************************************************************************
|
---|
327 | BOOL WIN32API SendNotifyMessageW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
---|
328 | {
|
---|
329 | #ifdef DEBUG
|
---|
330 | WriteLog("USER32: SendNotifyMessageW, not completely implemented\n");
|
---|
331 | #endif
|
---|
332 | return(SendMessageA(hwnd, Msg, wParam, lParam));
|
---|
333 | }
|
---|
334 | //******************************************************************************
|
---|
335 | //******************************************************************************
|
---|
336 | LPARAM WIN32API SetMessageExtraInfo(LPARAM lParam)
|
---|
337 | {
|
---|
338 | #ifdef DEBUG
|
---|
339 | WriteLog("USER32: SetMessageExtraInfo, not implemented\n");
|
---|
340 | #endif
|
---|
341 | return(0);
|
---|
342 | }
|
---|
343 | /*****************************************************************************
|
---|
344 | * Name : BOOL WIN32API SendMessageCallbackA
|
---|
345 | * Purpose : The SendMessageCallback function sends the specified message to
|
---|
346 | * a window or windows. The function calls the window procedure for
|
---|
347 | * the specified window and returns immediately. After the window
|
---|
348 | * procedure processes the message, the system calls the specified
|
---|
349 | * callback function, passing the result of the message processing
|
---|
350 | * and an application-defined value to the callback function.
|
---|
351 | * Parameters: HWND hwnd handle of destination window
|
---|
352 | * UINT uMsg message to send
|
---|
353 | * WPARAM wParam first message parameter
|
---|
354 | * LPARAM lParam second message parameter
|
---|
355 | * SENDASYNCPROC lpResultCallBack function to receive message value
|
---|
356 | * DWORD dwData value to pass to callback function
|
---|
357 | * Variables :
|
---|
358 | * Result : If the function succeeds, the return value is TRUE.
|
---|
359 | * If the function fails, the return value is FALSE. To get extended
|
---|
360 | * error information, call GetLastError.
|
---|
361 | * Remark :
|
---|
362 | * Status : UNTESTED STUB
|
---|
363 | *
|
---|
364 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
365 | *****************************************************************************/
|
---|
366 |
|
---|
367 | BOOL WIN32API SendMessageCallbackA(HWND hWnd,
|
---|
368 | UINT uMsg,
|
---|
369 | WPARAM wParam,
|
---|
370 | LPARAM lParam,
|
---|
371 | SENDASYNCPROC lpResultCallBack,
|
---|
372 | DWORD dwData)
|
---|
373 | {
|
---|
374 | dprintf(("USER32:SendMessageCallBackA (%08xh,%08xh,%08xh,%08xh,%08xh,%08x) not implemented.\n",
|
---|
375 | hWnd,
|
---|
376 | uMsg,
|
---|
377 | wParam,
|
---|
378 | lParam,
|
---|
379 | lpResultCallBack,
|
---|
380 | dwData));
|
---|
381 |
|
---|
382 | return (FALSE);
|
---|
383 | }
|
---|
384 |
|
---|
385 |
|
---|
386 | /*****************************************************************************
|
---|
387 | * Name : BOOL WIN32API SendMessageCallbackW
|
---|
388 | * Purpose : The SendMessageCallback function sends the specified message to
|
---|
389 | * a window or windows. The function calls the window procedure for
|
---|
390 | * the specified window and returns immediately. After the window
|
---|
391 | * procedure processes the message, the system calls the specified
|
---|
392 | * callback function, passing the result of the message processing
|
---|
393 | * and an application-defined value to the callback function.
|
---|
394 | * Parameters: HWND hwnd handle of destination window
|
---|
395 | * UINT uMsg message to send
|
---|
396 | * WPARAM wParam first message parameter
|
---|
397 | * LPARAM lParam second message parameter
|
---|
398 | * SENDASYNCPROC lpResultCallBack function to receive message value
|
---|
399 | * DWORD dwData value to pass to callback function
|
---|
400 | * Variables :
|
---|
401 | * Result : If the function succeeds, the return value is TRUE.
|
---|
402 | * If the function fails, the return value is FALSE. To get extended
|
---|
403 | * error information, call GetLastError.
|
---|
404 | * Remark :
|
---|
405 | * Status : UNTESTED STUB
|
---|
406 | *
|
---|
407 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
408 | *****************************************************************************/
|
---|
409 |
|
---|
410 | BOOL WIN32API SendMessageCallbackW(HWND hWnd,
|
---|
411 | UINT uMsg,
|
---|
412 | WPARAM wParam,
|
---|
413 | LPARAM lParam,
|
---|
414 | SENDASYNCPROC lpResultCallBack,
|
---|
415 | DWORD dwData)
|
---|
416 | {
|
---|
417 | dprintf(("USER32:SendMessageCallBackW (%08xh,%08xh,%08xh,%08xh,%08xh,%08x) not implemented.\n",
|
---|
418 | hWnd,
|
---|
419 | uMsg,
|
---|
420 | wParam,
|
---|
421 | lParam,
|
---|
422 | lpResultCallBack,
|
---|
423 | dwData));
|
---|
424 |
|
---|
425 | return (FALSE);
|
---|
426 | }
|
---|
427 | //******************************************************************************
|
---|
428 | //******************************************************************************
|
---|