source: trunk/src/user32/oslibmsg.cpp@ 7205

Last change on this file since 7205 was 7205, checked in by phaller, 24 years ago

fixed ESC processing

File size: 19.7 KB
Line 
1/* $Id: oslibmsg.cpp,v 1.46 2001-10-25 15:35:53 phaller Exp $ */
2/*
3 * Window message translation functions for OS/2
4 *
5 *
6 * Copyright 1999 Sander van Leeuwen (sandervl@xs4all.nl)
7 *
8 *
9 * Project Odin Software License can be found in LICENSE.TXT
10 *
11 * TODO: Some messages that are sent to the frame window are directly passed on to the client
12 * -> Get/PeekMessage never gets them as we return a dummy message for non-client windows
13 * (i.e. menu WM_COMMAND messages)
14 *
15 * TODO: Filter translation isn't correct! (for posted messages or messages that don't have
16 * a PM version.
17 *
18 */
19#define INCL_WIN
20#define INCL_PM
21#define INCL_DOSPROCESS
22#include <os2wrap.h>
23#include <string.h>
24#include <misc.h>
25#include "oslibmsg.h"
26#include <winconst.h>
27#include <win32api.h>
28#include <winuser32.h>
29#include "oslibutil.h"
30#include "timer.h"
31#include <thread.h>
32#include <wprocess.h>
33#include "pmwindow.h"
34#include "oslibwin.h"
35#include <win\hook.h>
36
37#define DBG_LOCALLOG DBG_oslibmsg
38#include "dbglocal.h"
39
40
41
42typedef BOOL (EXPENTRY FNTRANS)(MSG *, QMSG *);
43typedef FNTRANS *PFNTRANS;
44
45typedef struct
46{
47 ULONG msgOS2;
48 ULONG msgWin32;
49// PFNTRANS toOS2;
50// PFNTRANS toWIN32;
51} MSGTRANSTAB, *PMSGTRANSTAB;
52
53//NOTE: Must be ordered by win32 message id!!
54MSGTRANSTAB MsgTransTab[] = {
55 WM_NULL, WINWM_NULL,
56 WM_CREATE, WINWM_CREATE,
57 WM_DESTROY, WINWM_DESTROY,
58 WM_MOVE, WINWM_MOVE, //TODO: Sent directly
59 WM_SIZE, WINWM_SIZE, //TODO: Sent directly
60 WM_ACTIVATE, WINWM_ACTIVATE,
61 WM_SETFOCUS, WINWM_SETFOCUS,
62 WM_SETFOCUS, WINWM_KILLFOCUS,
63 WM_ENABLE, WINWM_ENABLE,
64 WM_PAINT, WINWM_PAINT,
65 WM_CLOSE, WINWM_CLOSE,
66 WM_QUIT, WINWM_QUIT,
67 WM_SHOW, WINWM_SHOWWINDOW,
68
69 WM_HITTEST, WINWM_NCHITTEST,
70
71 //todo: not always right if mouse msg turns out to be for the client window
72 WM_MOUSEMOVE, WINWM_NCMOUSEMOVE,
73 WM_BUTTON1DOWN, WINWM_NCLBUTTONDOWN,
74 WM_BUTTON1UP, WINWM_NCLBUTTONUP,
75 WM_BUTTON1DBLCLK, WINWM_NCLBUTTONDBLCLK,
76 WM_BUTTON2DOWN, WINWM_NCRBUTTONDOWN,
77 WM_BUTTON2UP, WINWM_NCRBUTTONUP,
78 WM_BUTTON2DBLCLK, WINWM_NCRBUTTONDBLCLK,
79 WM_BUTTON3DOWN, WINWM_NCMBUTTONDOWN,
80 WM_BUTTON3UP, WINWM_NCMBUTTONUP,
81 WM_BUTTON3DBLCLK, WINWM_NCMBUTTONDBLCLK,
82
83 //TODO: Needs better translation!
84 WM_CHAR, WINWM_KEYDOWN, //WM_KEYFIRST
85 WM_CHAR, WINWM_KEYUP,
86 WM_CHAR, WINWM_CHAR,
87 WM_CHAR, WINWM_DEADCHAR,
88 WM_CHAR, WINWM_SYSKEYDOWN,
89 WM_CHAR, WINWM_SYSKEYUP,
90 WM_CHAR, WINWM_SYSCHAR,
91 WM_CHAR, WINWM_SYSDEADCHAR,
92 WM_CHAR, WINWM_KEYLAST,
93
94 //
95 WM_TIMER, WINWM_TIMER,
96
97 //
98 //todo: not always right if mouse msg turns out to be for the nonclient window
99 WM_MOUSEMOVE, WINWM_MOUSEMOVE, //WM_MOUSEFIRST
100 WM_BUTTON1DOWN, WINWM_LBUTTONDOWN,
101 WM_BUTTON1UP, WINWM_LBUTTONUP,
102 WM_BUTTON1DBLCLK, WINWM_LBUTTONDBLCLK,
103 WM_BUTTON2DOWN, WINWM_RBUTTONDOWN,
104 WM_BUTTON2UP, WINWM_RBUTTONUP,
105 WM_BUTTON2DBLCLK, WINWM_RBUTTONDBLCLK,
106 WM_BUTTON3DOWN, WINWM_MBUTTONDOWN,
107 WM_BUTTON3UP, WINWM_MBUTTONUP,
108 WM_BUTTON3DBLCLK, WINWM_MBUTTONDBLCLK,
109 WM_BUTTON3DBLCLK, WINWM_MOUSEWHEEL, //WM_MOUSELAST
110 999999999, 999999999,
111};
112#define MAX_MSGTRANSTAB (sizeof(MsgTransTab)/sizeof(MsgTransTab[0]))
113
114//******************************************************************************
115//******************************************************************************
116void WinToOS2MsgTranslate(MSG *winMsg, QMSG *os2Msg, BOOL isUnicode)
117{
118// memcpy(os2Msg, winMsg, sizeof(MSG));
119// os2Msg->hwnd = Win32ToOS2Handle(winMsg->hwnd);
120// os2Msg->reserved = 0;
121}
122//******************************************************************************
123//TODO: NOT COMPLETE nor 100% CORRECT!!!
124//If both the minimum & maximum message are unknown, the result can be wrong (max > min)!
125//******************************************************************************
126ULONG TranslateWinMsg(ULONG msg, BOOL fMinFilter)
127{
128 if(msg == 0)
129 return 0;
130
131 if(msg >= WINWM_USER)
132 return msg + WIN32APP_POSTMSG;
133
134 for(int i=0;i<MAX_MSGTRANSTAB;i++)
135 {
136 if(fMinFilter && MsgTransTab[i].msgWin32 >= msg) {
137 return MsgTransTab[i].msgOS2;
138 }
139 else
140 if(!fMinFilter && MsgTransTab[i].msgWin32 >= msg) {
141 if(MsgTransTab[i].msgWin32 == msg)
142 return MsgTransTab[i].msgOS2;
143 else return MsgTransTab[i-1].msgOS2;
144 }
145 }
146
147 //not found, get everything
148 dprintf(("WARNING: TranslateWinMsg: message %x not found", msg));
149 return 0;
150}
151//******************************************************************************
152//******************************************************************************
153void OSLibWinPostQuitMessage(ULONG nExitCode)
154{
155 APIRET rc;
156
157 rc = WinPostQueueMsg(NULLHANDLE, WM_QUIT, MPFROMLONG(nExitCode), 0);
158 dprintf(("WinPostQueueMsg %d returned %d", nExitCode, rc));
159}
160//******************************************************************************
161//******************************************************************************
162LONG OSLibWinDispatchMsg(MSG *msg, BOOL isUnicode)
163{
164 TEB *teb;
165 QMSG os2msg;
166 LONG rc;
167
168 teb = GetThreadTEB();
169 if(teb == NULL) {
170 DebugInt3();
171 return FALSE;
172 }
173
174 //TODO: What to do if app changed msg? (translate)
175 // WinToOS2MsgTranslate(msg, &qmsg, isUnicode);
176
177 if(!memcmp(msg, &teb->o.odin.winmsg, sizeof(MSG)) || msg->hwnd == 0) {
178 memcpy(&os2msg, &teb->o.odin.os2msg, sizeof(QMSG));
179 teb->o.odin.os2msg.time = -1;
180 teb->o.odin.winmsg.time = -1;
181 if(msg->hwnd) {
182 teb->o.odin.nrOfMsgs = 1;
183 teb->o.odin.msgstate++; //odd -> next call to our PM window handler should dispatch the translated msg
184 memcpy(&teb->o.odin.msg, msg, sizeof(MSG));
185 }
186 if(os2msg.hwnd || os2msg.msg == WM_QUIT) {
187 memset(&teb->o.odin.os2msg, 0, sizeof(teb->o.odin.os2msg));
188 memset(&teb->o.odin.winmsg, 0, sizeof(teb->o.odin.winmsg));
189 return (LONG)WinDispatchMsg(teb->o.odin.hab, &os2msg);
190 }
191 //SvL: Don't dispatch messages sent by PostThreadMessage (correct??)
192 // Or WM_TIMER msgs with no window handle or timer proc
193 return 0;
194
195 }
196 else {//is this allowed?
197// dprintf(("WARNING: OSLibWinDispatchMsg: called with own message!"));
198 return SendMessageA(msg->hwnd, msg->message, msg->wParam, msg->lParam);
199 }
200}
201//******************************************************************************
202//******************************************************************************
203BOOL OSLibWinGetMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax,
204 BOOL isUnicode)
205{
206 BOOL rc, eaten;
207 TEB *teb;
208 QMSG os2msg;
209 HWND hwndOS2 = 0;
210 ULONG filtermin, filtermax;
211
212 if(hwnd) {
213 hwndOS2 = Win32ToOS2Handle(hwnd);
214 if(hwndOS2 == NULL) {
215 memset(pMsg, 0, sizeof(MSG));
216 dprintf(("GetMsg: window %x NOT FOUND!", hwnd));
217 SetLastError(ERROR_INVALID_WINDOW_HANDLE_W);
218 return TRUE;
219 }
220 }
221
222 teb = GetThreadTEB();
223 if(teb == NULL) {
224 DebugInt3();
225 return TRUE;
226 }
227
228 if(teb->o.odin.fTranslated && (!hwnd || hwnd == teb->o.odin.msgWCHAR.hwnd)) {
229 if(uMsgFilterMin) {
230 if(teb->o.odin.msgWCHAR.message < uMsgFilterMin)
231 goto continuegetmsg;
232 }
233 if(uMsgFilterMax) {
234 if(teb->o.odin.msgWCHAR.message > uMsgFilterMax)
235 goto continuegetmsg;
236 }
237 teb->o.odin.fTranslated = FALSE;
238 memcpy(pMsg, &teb->o.odin.msgWCHAR, sizeof(MSG));
239 teb->o.odin.os2msg.msg = 0;
240 teb->o.odin.os2msg.hwnd = 0;
241 return (pMsg->message != WINWM_QUIT);
242 }
243
244continuegetmsg:
245 if(hwnd) {
246 filtermin = TranslateWinMsg(uMsgFilterMin, TRUE);
247 filtermax = TranslateWinMsg(uMsgFilterMax, FALSE);
248 if(filtermin > filtermax) {
249 ULONG tmp = filtermin;
250 filtermin = filtermax;
251 filtermax = filtermin;
252 }
253 do {
254 WinWaitMsg(teb->o.odin.hab, filtermin, filtermax);
255 rc = OSLibWinPeekMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax, PM_REMOVE_W, isUnicode);
256 }
257 while(rc == FALSE);
258
259 return (pMsg->message != WINWM_QUIT);
260 }
261 else
262 {
263 filtermin = TranslateWinMsg(uMsgFilterMin, TRUE);
264 filtermax = TranslateWinMsg(uMsgFilterMax, FALSE);
265 if(filtermin > filtermax) {
266 ULONG tmp = filtermin;
267 filtermin = filtermax;
268 filtermax = filtermin;
269 }
270 do {
271 eaten = FALSE;
272 rc = WinGetMsg(teb->o.odin.hab, &os2msg, 0, filtermin, filtermax);
273 if (os2msg.msg == WM_TIMER)
274 eaten = TIMER_HandleTimer(&os2msg);
275 } while (eaten);
276 }
277 if(OS2ToWinMsgTranslate((PVOID)teb, &os2msg, pMsg, isUnicode, MSG_REMOVE) == FALSE) {
278 //dispatch untranslated message immediately
279 WinDispatchMsg(teb->o.odin.hab, &os2msg);
280 //and get the next one
281 return OSLibWinGetMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax, isUnicode);
282 }
283
284 memcpy(&teb->o.odin.os2msg, &os2msg, sizeof(QMSG));
285 memcpy(&teb->o.odin.winmsg, pMsg, sizeof(MSG));
286
287 // send keyboard messages to the registered hooks
288 if(pMsg->message <= WINWM_KEYLAST && pMsg->message >= WINWM_KEYDOWN)
289 {
290// if(ProcessKbdHookLL(pMsg, TRUE))
291// goto continuegetmsg;
292
293 // @@@PH
294 // only supposed to be called upon WM_KEYDOWN
295 // and WM_KEYUP according to docs.
296 if(ProcessKbdHook(pMsg, TRUE))
297 goto continuegetmsg;
298 }
299 return rc;
300}
301//******************************************************************************
302//PeekMessage retrieves only messages associated with the window identified by the
303//hwnd parameter or any of its children as specified by the IsChild function, and within
304//the range of message values given by the uMsgFilterMin and uMsgFilterMax
305//parameters. If hwnd is NULL, PeekMessage retrieves messages for any window that
306//belongs to the current thread making the call. (PeekMessage does not retrieve
307//messages for windows that belong to other threads.) If hwnd is -1, PeekMessage only
308//returns messages with a hwnd value of NULL, as posted by the PostAppMessage
309//function. If uMsgFilterMin and uMsgFilterMax are both zero, PeekMessage returns all
310//available messages (no range filtering is performed).
311//TODO: Not working as specified right now!
312//******************************************************************************
313BOOL OSLibWinPeekMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax,
314 DWORD fRemove, BOOL isUnicode)
315{
316 BOOL rc, eaten;
317 TEB *teb;
318 QMSG os2msg;
319 HWND hwndOS2 = 0;
320
321 if(hwnd && hwnd != -1) {
322 hwndOS2 = Win32ToOS2Handle(hwnd);
323 if(hwndOS2 == NULL) {
324 dprintf(("PeekMsg: window %x NOT FOUND!", hwnd));
325 SetLastError(ERROR_INVALID_WINDOW_HANDLE_W);
326 return FALSE;
327 }
328 }
329
330 teb = GetThreadTEB();
331 if(teb == NULL) {
332 DebugInt3();
333 return FALSE;
334 }
335
336 if(teb->o.odin.fTranslated && (!hwnd || hwnd == teb->o.odin.msgWCHAR.hwnd)) {
337 if(uMsgFilterMin) {
338 if(teb->o.odin.msgWCHAR.message < uMsgFilterMin)
339 goto continuepeekmsg;
340 }
341 if(uMsgFilterMax) {
342 if(teb->o.odin.msgWCHAR.message > uMsgFilterMax)
343 goto continuepeekmsg;
344 }
345
346 if(fRemove & PM_REMOVE_W) {
347 teb->o.odin.fTranslated = FALSE;
348 teb->o.odin.os2msg.msg = 0;
349 teb->o.odin.os2msg.hwnd = 0;
350 }
351 memcpy(pMsg, &teb->o.odin.msgWCHAR, sizeof(MSG));
352 return TRUE;
353 }
354
355continuepeekmsg:
356 do {
357 eaten = FALSE;
358 rc = WinPeekMsg(teb->o.odin.hab, &os2msg, hwndOS2, TranslateWinMsg(uMsgFilterMin, TRUE),
359 TranslateWinMsg(uMsgFilterMax, FALSE), (fRemove & PM_REMOVE_W) ? PM_REMOVE : PM_NOREMOVE);
360
361 if (rc && (fRemove & PM_REMOVE_W) && os2msg.msg == WM_TIMER) {
362 eaten = TIMER_HandleTimer(&os2msg);
363 }
364 }
365 while (eaten && rc);
366
367 if(rc == FALSE) {
368 return FALSE;
369 }
370
371 // @@@PH
372 // warning - OS2ToWinMsgTranslate might insert additional messages
373 // into the queue
374 if(OS2ToWinMsgTranslate((PVOID)teb, &os2msg, pMsg, isUnicode, (fRemove & PM_REMOVE_W) ? MSG_REMOVE : MSG_NOREMOVE) == FALSE)
375 {
376 //unused PM message; dispatch immediately and grab next one
377 dprintf2(("OSLibWinPeekMsg: Untranslated message; dispatched immediately"));
378 if(!(fRemove & PM_REMOVE_W)) {
379 rc = WinPeekMsg(teb->o.odin.hab, &os2msg, hwndOS2, TranslateWinMsg(uMsgFilterMin, TRUE),
380 TranslateWinMsg(uMsgFilterMax, FALSE), PM_REMOVE);
381 }
382 WinDispatchMsg(teb->o.odin.hab, &os2msg);
383 return OSLibWinPeekMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax,
384 fRemove, isUnicode);
385 }
386 //TODO: This is not safe! There's no guarantee this message will be dispatched and it might overwrite a previous message
387 if(fRemove & PM_REMOVE_W) {
388 memcpy(&teb->o.odin.os2msg, &os2msg, sizeof(QMSG));
389 memcpy(&teb->o.odin.winmsg, pMsg, sizeof(MSG));
390 }
391
392 // send keyboard messages to the registered hooks
393 if(pMsg->message <= WINWM_KEYLAST && pMsg->message >= WINWM_KEYDOWN)
394 {
395// if(ProcessKbdHookLL(pMsg, fRemove))
396// goto continuepeekmsg;
397
398 // @@@PH
399 // only supposed to be called upon WM_KEYDOWN
400 // and WM_KEYUP according to docs.
401 if(ProcessKbdHook(pMsg, fRemove))
402 goto continuepeekmsg;
403 }
404
405 return rc;
406}
407//******************************************************************************
408//******************************************************************************
409ULONG OSLibWinQueryMsgTime()
410{
411 return WinQueryMsgTime(GetThreadHAB());
412}
413//******************************************************************************
414//******************************************************************************
415BOOL OSLibWinWaitMessage()
416{
417 return WinWaitMsg(GetThreadHAB(), 0, 0);
418}
419//******************************************************************************
420//TODO: QS_HOTKEY
421//******************************************************************************
422ULONG OSLibWinQueryQueueStatus()
423{
424 ULONG statusOS2, statusWin32 = 0;
425
426 statusOS2 = WinQueryQueueStatus(HWND_DESKTOP);
427
428 if(statusOS2 & QS_KEY)
429 statusWin32 |= QS_KEY_W;
430 if(statusOS2 & QS_MOUSEBUTTON)
431 statusWin32 |= QS_MOUSEBUTTON_W;
432 if(statusOS2 & QS_MOUSEMOVE)
433 statusWin32 |= QS_MOUSEMOVE_W;
434 if(statusOS2 & QS_TIMER)
435 statusWin32 |= QS_TIMER_W;
436 if(statusOS2 & QS_PAINT)
437 statusWin32 |= QS_PAINT_W;
438 if(statusOS2 & QS_POSTMSG)
439 statusWin32 |= QS_POSTMESSAGE_W;
440 if(statusOS2 & QS_SENDMSG)
441 statusWin32 |= QS_SENDMESSAGE_W;
442
443 return statusWin32;
444}
445//******************************************************************************
446//******************************************************************************
447BOOL OSLibWinInSendMessage()
448{
449 return WinInSendMsg(GetThreadHAB());
450}
451//******************************************************************************
452//******************************************************************************
453DWORD OSLibWinGetMessagePos()
454{
455 APIRET rc;
456 POINTL ptl;
457
458 rc = WinQueryMsgPos(GetThreadHAB(), &ptl);
459 if(!rc) {
460 return 0;
461 }
462 //convert to windows coordinates
463 return MAKEULONG(ptl.x,mapScreenY(ptl.y));
464}
465//******************************************************************************
466//******************************************************************************
467LONG OSLibWinGetMessageTime()
468{
469 return (LONG)WinQueryMsgTime(GetThreadHAB());
470}
471//******************************************************************************
472//******************************************************************************
473BOOL OSLibWinReplyMessage(ULONG result)
474{
475 return (BOOL)WinReplyMsg( NULLHANDLE, NULLHANDLE, HMQ_CURRENT, (MRESULT)result);
476}
477//******************************************************************************
478//******************************************************************************
479ULONG OSLibSendMessage(HWND hwnd, ULONG msg, ULONG wParam, ULONG lParam, BOOL fUnicode)
480{
481 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET));
482
483 if(NULL == packet)
484 {
485 dprintf(("user32::oslibmsg::OSLibSendMessage - allocated packet structure is NULL, heapmin=%d\n",
486 _sheapmin() ));
487
488 // PH: we cannot provide a correct returncode :(
489 DebugInt3();
490 return 0;
491 }
492
493 packet->wParam = wParam;
494 packet->lParam = lParam;
495
496 return (ULONG)WinSendMsg(hwnd, WIN32APP_POSTMSG+msg, (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (MPARAM)packet);
497}
498//******************************************************************************
499//******************************************************************************
500ULONG OSLibWinBroadcastMsg(ULONG msg, ULONG wParam, ULONG lParam, BOOL fSend)
501{
502 return WinBroadcastMsg(HWND_DESKTOP, WIN32APP_POSTMSG+msg, (MPARAM)wParam, (MPARAM)lParam,
503 (fSend) ? BMSG_SEND : BMSG_POST);
504}
505//******************************************************************************
506//******************************************************************************
507BOOL OSLibPostMessage(HWND hwnd, ULONG msg, ULONG wParam, ULONG lParam, BOOL fUnicode)
508{
509 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET));
510
511 if (NULL == packet)
512 {
513 dprintf(("user32::oslibmsg::OSLibPostMessage - allocated packet structure is NULL, heapmin=%d\n",
514 _sheapmin() ));
515
516 // PH: we can provide a correct returncode
517 DebugInt3();
518 return FALSE;
519 }
520 packet->wParam = wParam;
521 packet->lParam = lParam;
522 return WinPostMsg(hwnd, WIN32APP_POSTMSG+msg, (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (MPARAM)packet);
523}
524//******************************************************************************
525//Direct posting of messages that must remain invisible to the win32 app
526//******************************************************************************
527BOOL OSLibPostMessageDirect(HWND hwnd, ULONG msg, ULONG wParam, ULONG lParam)
528{
529 return WinPostMsg(hwnd, msg, (MPARAM)wParam, (MPARAM)lParam);
530}
531//******************************************************************************
532BOOL _System _O32_PostThreadMessage( DWORD, UINT, WPARAM, LPARAM );
533
534inline BOOL O32_PostThreadMessage(DWORD a, UINT b, WPARAM c, LPARAM d)
535{
536 BOOL yyrc;
537 USHORT sel = RestoreOS2FS();
538
539 yyrc = _O32_PostThreadMessage(a, b, c, d);
540 SetFS(sel);
541
542 return yyrc;
543}
544//******************************************************************************
545BOOL OSLibPostThreadMessage(ULONG threadid, UINT msg, WPARAM wParam, LPARAM lParam, BOOL fUnicode)
546{
547 TEB *teb = GetTEBFromThreadId(threadid);
548 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET));
549 BOOL ret;
550
551 if(NULL == packet)
552 {
553 dprintf(("user32::oslibmsg::OSLibPostMessage - allocated packet structure is NULL, heapmin=%d\n",
554 _sheapmin() ));
555
556 DebugInt3();
557 // PH: we can provide a correct returncode
558 return FALSE;
559 }
560
561 if(teb == NULL) {
562 dprintf(("OSLibPostThreadMessage: thread %x not found!", threadid));
563 return FALSE;
564 }
565 dprintf(("PostThreadMessageA %x %x %x %x -> hmq %x", threadid, msg, wParam, lParam, teb->o.odin.hmq));
566 packet->wParam = wParam;
567 packet->lParam = lParam;
568
569 ret = WinPostQueueMsg((HMQ)teb->o.odin.hmq, WIN32APP_POSTMSG+msg,
570 (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA),
571 (MPARAM)packet);
572
573 if(ret == FALSE)
574 {
575 SetLastError(ERROR_INVALID_PARAMETER_W);
576 return FALSE;
577 }
578 SetLastError(ERROR_SUCCESS_W);
579 return TRUE;
580}
581//******************************************************************************
582//******************************************************************************
583
Note: See TracBrowser for help on using the repository browser.