Changeset 1855 for trunk/src/user32/windowmsg.cpp
- Timestamp:
- Nov 27, 1999, 1:10:22 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/windowmsg.cpp
r1831 r1855 1 /* $Id: windowmsg.cpp,v 1. 6 1999-11-24 19:32:23sandervl Exp $ */1 /* $Id: windowmsg.cpp,v 1.7 1999-11-27 00:10:22 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window message APIs for OS/2 … … 9 9 * Copyright 1993, 1994 Alexandre Julliard 10 10 * 11 * TODO: GetQueueStatus: QS_HOTKEY (oslibmsg.cpp) & low word bits 12 * TODO: MsgWaitForMultipleObjects: timeout isn't handled correctly (can return too late) 11 13 * 12 14 * Project Odin Software License can be found in LICENSE.TXT … … 1017 1019 return WINPROC_CallProc32WTo32A( func, hwnd, msg, wParam, lParam); 1018 1020 } 1021 //****************************************************************************** 1022 //TODO: QS_HOTKEY (oslibmsg.cpp) & low word bits 1023 //high word = messages currently in queue 1024 //low word = messages that have been added to the queue and are still in the 1025 // queue since the last call to GetQueueStatus 1026 //****************************************************************************** 1027 DWORD WIN32API GetQueueStatus( UINT flags) 1028 { 1029 DWORD queueStatus; 1030 1031 dprintf(("USER32: GetQueueStatus")); 1032 queueStatus = OSLibWinQueryQueueStatus(); 1033 1034 queueStatus = MAKELONG(queueStatus, queueStatus); 1035 return queueStatus & MAKELONG(flags, flags); 1036 } 1037 /***************************************************************************** 1038 * Name : BOOL WIN32API GetInputState 1039 * Purpose : The GetInputState function determines whether there are 1040 * mouse-button or keyboard messages in the calling thread's message queue. 1041 * Parameters: 1042 * Variables : 1043 * Result : If the queue contains one or more new mouse-button or keyboard 1044 * messages, the return value is TRUE. 1045 * If the function fails, the return value is FALSE. 1046 * Remark : 1047 * Status : UNTESTED STUB 1048 * 1049 * Author : Patrick Haller [Thu, 1998/02/26 11:55] 1050 *****************************************************************************/ 1051 BOOL WIN32API GetInputState(VOID) 1052 { 1053 DWORD queueStatus; 1054 1055 dprintf(("USER32:GetInputState()")); 1056 queueStatus = OSLibWinQueryQueueStatus(); 1057 1058 return (queueStatus & (QS_KEY | QS_MOUSEBUTTON)) ? TRUE : FALSE; 1059 } 1060 //****************************************************************************** 1061 /* Synchronization Functions */ 1062 //****************************************************************************** 1063 DWORD MsgWaitForMultipleObjects(DWORD nCount, LPHANDLE pHandles, BOOL fWaitAll, 1064 DWORD dwMilliseconds, DWORD dwWakeMask) 1065 { 1066 DWORD curtime, endtime; 1067 1068 dprintf(("MsgWaitForMultipleObjects %x %x %d %d %x", nCount, pHandles, fWaitAll, dwMilliseconds, dwWakeMask)); 1069 // @@@PH this is a temporary bugfix for WINFILE.EXE 1070 if (nCount == 0) 1071 { 1072 if(dwMilliseconds == 0) { 1073 if(GetQueueStatus(dwWakeMask) == 0) { 1074 return WAIT_TIMEOUT; 1075 } 1076 return WAIT_OBJECT_0; 1077 } 1078 //SvL: Check time, wait for any message, check msg type and determine if 1079 // we have to return 1080 //TODO: Timeout isn't handled correctly (can return too late) 1081 curtime = GetCurrentTime(); 1082 endtime = curtime + dwMilliseconds; 1083 while(curtime < endtime || dwMilliseconds == INFINITE) { 1084 if(OSLibWinWaitMessage() == FALSE) { 1085 dprintf(("OSLibWinWaitMessage returned FALSE!")); 1086 return -1; 1087 } 1088 if(GetQueueStatus(dwWakeMask) != 0) { 1089 return WAIT_OBJECT_0; 1090 } 1091 curtime = GetCurrentTime(); 1092 } 1093 return WAIT_TIMEOUT; 1094 } 1095 return O32_MsgWaitForMultipleObjects(nCount,pHandles,fWaitAll,dwMilliseconds,dwWakeMask); 1096 }
Note:
See TracChangeset
for help on using the changeset viewer.