Ignore:
Timestamp:
Feb 5, 2002, 6:59:31 PM (24 years ago)
Author:
sandervl
Message:

message handling changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/windowmsg.cpp

    r7667 r7801  
    1 /* $Id: windowmsg.cpp,v 1.32 2001-12-21 18:43:59 sandervl Exp $ */
     1/* $Id: windowmsg.cpp,v 1.33 2002-02-05 17:59:02 sandervl Exp $ */
    22/*
    33 * Win32 window message APIs for OS/2
    44 *
    5  * Copyright 1999 Sander van Leeuwen
     5 * Copyright 1999-2001 Sander van Leeuwen
    66 *
    77 * Parts based on Wine Windows code (windows\message.c) 990508
     
    3737
    3838
    39 //******************************************************************************
    40 //******************************************************************************
    41 VOID WIN32API PostQuitMessage( int nExitCode)
    42 {
    43     dprintf(("USER32:  PostQuitMessage\n"));
    44     OSLibWinPostQuitMessage(nExitCode);
    45 }
    4639//******************************************************************************
    4740//******************************************************************************
     
    172165//******************************************************************************
    173166//******************************************************************************
    174 LRESULT WIN32API SendMessageA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
    175 {
    176   Win32BaseWindow *window;
    177   LRESULT result;
    178 
    179     if (hwnd == HWND_BROADCAST|| hwnd == HWND_TOPMOST)
    180     {
    181         Win32BaseWindow::BroadcastMessageA(BROADCAST_SEND, msg, wParam, lParam);
    182         return TRUE;
    183     }
    184 
    185     window = Win32BaseWindow::GetWindowFromHandle(hwnd);
    186     if(!window) {
    187         dprintf(("SendMessageA, %x %x %x window %x not found", msg, wParam, lParam, hwnd));
    188         return 0;
    189     }
    190     result = window->SendMessageA(msg, wParam, lParam);
    191     RELEASE_WNDOBJ(window);
    192     return result;
    193 }
    194 //******************************************************************************
    195 //******************************************************************************
    196 LRESULT WIN32API SendMessageW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
    197 {
    198   Win32BaseWindow *window;
    199   LRESULT result;
    200 
    201     if (hwnd == HWND_BROADCAST|| hwnd == HWND_TOPMOST)
    202     {
    203         Win32BaseWindow::BroadcastMessageW(BROADCAST_SEND, msg, wParam, lParam);
    204         return TRUE;
    205     }
    206 
    207     window = Win32BaseWindow::GetWindowFromHandle(hwnd);
    208     if(!window) {
    209         dprintf(("SendMessageW, window %x not found", hwnd));
    210         return 0;
    211     }
    212     result = window->SendMessageW(msg, wParam, lParam);
    213     RELEASE_WNDOBJ(window);
    214     return result;
    215 }
    216 //******************************************************************************
    217 //******************************************************************************
    218 BOOL WIN32API PostMessageA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
    219 {
    220   Win32BaseWindow *window;
    221   HWND hwndOS2;
    222 
    223     if (hwnd == HWND_BROADCAST) //Not HWND_TOPMOST???
    224     {
    225         Win32BaseWindow::BroadcastMessageA(BROADCAST_POST, msg, wParam, lParam);
    226         return TRUE;
    227     }
    228 
    229     if(hwnd == NULL)
    230         return PostThreadMessageA(GetCurrentThreadId(), msg, wParam, lParam);
    231 
    232     window = Win32BaseWindow::GetWindowFromHandle(hwnd);
    233     if(!window) {
    234         dprintf(("PostMessageA, window %x not found", hwnd));
    235         return FALSE;
    236     }
    237     hwndOS2 = window->getOS2WindowHandle();
    238     RELEASE_WNDOBJ(window);
    239     dprintf(("PostMessageA, %x %x %x %x", hwnd, msg, wParam, lParam));
    240     return OSLibPostMessage(hwndOS2, msg, wParam, lParam, FALSE);
    241 }
    242 //******************************************************************************
    243 //******************************************************************************
    244 BOOL WIN32API PostMessageW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
    245 {
    246   Win32BaseWindow *window;
    247   HWND hwndOS2;
    248 
    249     if (hwnd == HWND_BROADCAST) //Not HWND_TOPMOST???
    250     {
    251         Win32BaseWindow::BroadcastMessageW(BROADCAST_POST, msg, wParam, lParam);
    252         return TRUE;
    253     }
    254 
    255     if(hwnd == NULL)
    256         return PostThreadMessageW(GetCurrentThreadId(), msg, wParam, lParam);
    257 
    258     window = Win32BaseWindow::GetWindowFromHandle(hwnd);
    259     if(!window) {
    260         dprintf(("PostMessageW, window %x not found", hwnd));
    261         return FALSE;
    262     }
    263     hwndOS2 = window->getOS2WindowHandle();
    264     RELEASE_WNDOBJ(window);
    265     dprintf(("PostMessageW, %x %x %x %x", hwnd, msg, wParam, lParam));
    266     return OSLibPostMessage(hwndOS2, msg, wParam, lParam, TRUE);
    267 }
    268 //******************************************************************************
    269 //******************************************************************************
    270 BOOL WIN32API PostThreadMessageA( DWORD threadid, UINT msg, WPARAM wParam, LPARAM lParam)
    271 {
    272     return OSLibPostThreadMessage(threadid, msg, wParam, lParam, FALSE);
    273 }
    274 //******************************************************************************
    275 //******************************************************************************
    276 BOOL WIN32API PostThreadMessageW( DWORD threadid, UINT msg, WPARAM wParam, LPARAM lParam)
    277 {
    278     return OSLibPostThreadMessage(threadid, msg, wParam, lParam, TRUE);
    279 }
    280 //******************************************************************************
    281 //******************************************************************************
    282167BOOL WIN32API WaitMessage(void)
    283168{
     
    298183    dprintf(("USER32: ReplyMessage %x", result));
    299184    return OSLibWinReplyMessage(result);
     185}
     186//******************************************************************************
     187//******************************************************************************
     188VOID WIN32API PostQuitMessage( int nExitCode)
     189{
     190    dprintf(("USER32:  PostQuitMessage\n"));
     191    OSLibWinPostQuitMessage(nExitCode);
    300192}
    301193//******************************************************************************
     
    323215  dprintf(("USER32:  SetMessageQueue\n"));
    324216  return(TRUE);
    325 }
    326 //******************************************************************************
    327 //******************************************************************************
    328 LRESULT WIN32API SendMessageTimeoutA(HWND hwnd, UINT Msg, WPARAM wParam,
    329                     LPARAM lParam, UINT fuFlags, UINT uTimeOut,
    330                     LPDWORD lpdwResult)
    331 {
    332   dprintf(("USER32:  SendMessageTimeoutA, partially implemented\n"));
    333   //ignore fuFlags & wTimeOut
    334   *lpdwResult = SendMessageA(hwnd, Msg, wParam, lParam);
    335   return(TRUE);
    336 }
    337 //******************************************************************************
    338 //******************************************************************************
    339 LRESULT WIN32API SendMessageTimeoutW(HWND hwnd, UINT Msg, WPARAM wParam,
    340                     LPARAM lParam, UINT fuFlags, UINT uTimeOut,
    341                     LPDWORD lpdwResult)
    342 {
    343   dprintf(("USER32:  SendMessageTimeoutW, partially implemented\n"));
    344   return(SendMessageTimeoutA(hwnd, Msg, wParam, lParam, fuFlags, uTimeOut, lpdwResult));
    345 }
    346 //******************************************************************************
    347 //******************************************************************************
    348 BOOL WIN32API SendNotifyMessageA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
    349 {
    350   dprintf(("USER32:  SendNotifyMessageA, not completely implemented\n"));
    351   return(SendMessageA(hwnd, Msg, wParam, lParam));
    352 }
    353 //******************************************************************************
    354 //******************************************************************************
    355 BOOL WIN32API SendNotifyMessageW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)
    356 {
    357   dprintf(("USER32:  SendNotifyMessageW, not completely implemented\n"));
    358   return(SendMessageA(hwnd, Msg, wParam, lParam));
    359 }
    360 /*****************************************************************************
    361  * Name      : BOOL WIN32API SendMessageCallbackA
    362  * Purpose   : The SendMessageCallback function sends the specified message to
    363  *             a window or windows. The function calls the window procedure for
    364  *             the specified window and returns immediately. After the window
    365  *             procedure processes the message, the system calls the specified
    366  *             callback function, passing the result of the message processing
    367  *             and an application-defined value to the callback function.
    368  * Parameters: HWND  hwnd                      handle of destination window
    369  *             UINT  uMsg                      message to send
    370  *             WPARAM  wParam                  first message parameter
    371  *             LPARAM  lParam                  second message parameter
    372  *             SENDASYNCPROC  lpResultCallBack function to receive message value
    373  *             DWORD  dwData                   value to pass to callback function
    374  * Variables :
    375  * Result    : If the function succeeds, the return value is TRUE.
    376  *             If the function fails, the return value is FALSE. To get extended
    377  *             error information, call GetLastError.
    378  * Remark    :
    379  * Status    : UNTESTED STUB
    380  *
    381  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    382  *****************************************************************************/
    383 
    384 BOOL WIN32API SendMessageCallbackA(HWND          hWnd,
    385                                    UINT          uMsg,
    386                                    WPARAM        wParam,
    387                                    LPARAM        lParam,
    388                                    SENDASYNCPROC lpResultCallBack,
    389                                    DWORD         dwData)
    390 {
    391   dprintf(("USER32:SendMessageCallBackA (%08xh,%08xh,%08xh,%08xh,%08xh,%08x) not implemented.\n",
    392          hWnd,
    393          uMsg,
    394          wParam,
    395          lParam,
    396          lpResultCallBack,
    397          dwData));
    398 
    399   return (FALSE);
    400 }
    401 
    402 
    403 /*****************************************************************************
    404  * Name      : BOOL WIN32API SendMessageCallbackW
    405  * Purpose   : The SendMessageCallback function sends the specified message to
    406  *             a window or windows. The function calls the window procedure for
    407  *             the specified window and returns immediately. After the window
    408  *             procedure processes the message, the system calls the specified
    409  *             callback function, passing the result of the message processing
    410  *             and an application-defined value to the callback function.
    411  * Parameters: HWND  hwnd                      handle of destination window
    412  *             UINT  uMsg                      message to send
    413  *             WPARAM  wParam                  first message parameter
    414  *             LPARAM  lParam                  second message parameter
    415  *             SENDASYNCPROC  lpResultCallBack function to receive message value
    416  *             DWORD  dwData                   value to pass to callback function
    417  * Variables :
    418  * Result    : If the function succeeds, the return value is TRUE.
    419  *             If the function fails, the return value is FALSE. To get extended
    420  *             error information, call GetLastError.
    421  * Remark    :
    422  * Status    : UNTESTED STUB
    423  *
    424  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    425  *****************************************************************************/
    426 
    427 BOOL WIN32API SendMessageCallbackW(HWND          hWnd,
    428                                       UINT          uMsg,
    429                                       WPARAM        wParam,
    430                                       LPARAM        lParam,
    431                                       SENDASYNCPROC lpResultCallBack,
    432                                       DWORD         dwData)
    433 {
    434   dprintf(("USER32:SendMessageCallBackW (%08xh,%08xh,%08xh,%08xh,%08xh,%08x) not implemented.\n",
    435          hWnd,
    436          uMsg,
    437          wParam,
    438          lParam,
    439          lpResultCallBack,
    440          dwData));
    441 
    442   return (FALSE);
    443 }
    444 /*****************************************************************************
    445  * Name      : long WIN32API BroadcastSystemMessage
    446  * Purpose   : The BroadcastSystemMessage function sends a message to the given
    447  *             recipients. The recipients can be applications, installable
    448  *             drivers, Windows-based network drivers, system-level device
    449  *             drivers, or any combination of these system components.
    450  * Parameters: DWORD   dwFlags,
    451                LPDWORD lpdwRecipients,
    452                UINT    uiMessage,
    453                WPARAM  wParam,
    454                LPARAM  lParam
    455  * Variables :
    456  * Result    : If the function succeeds, the return value is a positive value.
    457  *             If the function is unable to broadcast the message, the return value is -1.
    458  *             If the dwFlags parameter is BSF_QUERY and at least one recipient returned FALSE to the corresponding message, the return value is zero.
    459  * Remark    :
    460  * Status    : UNTESTED STUB
    461  *
    462  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    463  *****************************************************************************/
    464 
    465 long WIN32API BroadcastSystemMessage(DWORD   dwFlags,
    466                                         LPDWORD lpdwRecipients,
    467                                         UINT    uiMessage,
    468                                         WPARAM  wParam,
    469                                         LPARAM  lParam)
    470 {
    471   dprintf(("USER32:BroadcastSystemMessage(%08xh,%08xh,%08xh,%08xh,%08x) not implemented.\n",
    472         dwFlags,
    473         lpdwRecipients,
    474         uiMessage,
    475         wParam,
    476         lParam));
    477 
    478   return (-1);
    479217}
    480218//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.