Ignore:
Timestamp:
Sep 29, 1999, 11:16:32 AM (26 years ago)
Author:
sandervl
Message:

WM_ACTIVATE(APP) changes

File:
1 edited

Legend:

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

    r1091 r1093  
    1 /* $Id: win32wbase.cpp,v 1.19 1999-09-29 08:27:15 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.20 1999-09-29 09:16:32 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    914914//******************************************************************************
    915915//******************************************************************************
    916 ULONG Win32BaseWindow::MsgActivate(BOOL fActivate, HWND hwnd)
    917 {
    918     if(SendInternalMessageA(WM_NCACTIVATE, fActivate, 0) == FALSE)
     916ULONG Win32BaseWindow::MsgActivate(BOOL fActivate, BOOL fMinimized, HWND hwnd)
     917{
     918 ULONG rc, curprocid, procidhwnd = -1, threadidhwnd = 0;
     919
     920    //According to SDK docs, if app returns FALSE & window is being deactivated,
     921    //default processing is cancelled
     922    //TODO: According to Wine we should proceed anyway if window is sysmodal
     923    if(SendInternalMessageA(WM_NCACTIVATE, fActivate, 0) == FALSE && !fActivate)
    919924    {
    920         if(!fActivate) {
    921             return 1;
    922         }
    923     }
    924     return SendInternalMessageA(WM_ACTIVATE, (fActivate) ? WA_ACTIVE : WA_INACTIVE, hwnd);
     925        return 0;
     926    }
     927    rc = SendInternalMessageA(WM_ACTIVATE, MAKELONG((fActivate) ? WA_ACTIVE : WA_INACTIVE, fMinimized), hwnd);
     928
     929    curprocid  = GetCurrentProcessId();
     930    if(hwnd) {
     931            threadidhwnd = GetWindowThreadProcessId(hwnd, &procidhwnd);
     932    }
     933
     934    if(curprocid != procidhwnd && fActivate) {
     935        SendInternalMessageA(WM_ACTIVATEAPP, 1, threadidhwnd);
     936    }
     937    return rc;
    925938}
    926939//******************************************************************************
     
    10611074ULONG Win32BaseWindow::MsgSetFocus(HWND hwnd)
    10621075{
    1063     if(hwnd == 0) {
    1064             //other app lost focus
    1065             SendInternalMessageA(WM_ACTIVATEAPP, TRUE, 0); //TODO: Need thread id from hwnd app
    1066     }
    1067     return  SendInternalMessageA(WM_SETFOCUS, OS2ToWin32Handle (hwnd), 0);
     1076    return  SendInternalMessageA(WM_SETFOCUS, hwnd, 0);
    10681077}
    10691078//******************************************************************************
     
    10711080ULONG Win32BaseWindow::MsgKillFocus(HWND hwnd)
    10721081{
    1073     if(hwnd == 0) {
    1074             //other app lost focus
    1075             SendInternalMessageA(WM_ACTIVATEAPP, FALSE, 0); //TODO: Need thread id from hwnd app
    1076     }
    1077     return  SendInternalMessageA(WM_KILLFOCUS, OS2ToWin32Handle (hwnd), 0);
     1082    return  SendInternalMessageA(WM_KILLFOCUS, hwnd, 0);
    10781083}
    10791084//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.