Changeset 7200 for trunk/src


Ignore:
Timestamp:
Oct 25, 2001, 12:40:45 PM (24 years ago)
Author:
sandervl
Message:

WM_ACTIVATEAPP fix

Location:
trunk/src/user32
Files:
2 edited

Legend:

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

    r7195 r7200  
    1 /* $Id: pmwindow.cpp,v 1.157 2001-10-24 15:41:54 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.158 2001-10-25 10:40:45 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    6262
    6363static PFNWP pfnFrameWndProc = NULL;
     64static HWND  hwndFocusChange = 0;
    6465
    6566MRESULT EXPENTRY Win32WindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
     
    12531254#endif
    12541255
    1255 #ifdef DEBUG
    12561256    case WM_FOCUSCHANGE:
    12571257    {
     
    12611261        USHORT fsFocusChange = SHORT2FROMMP(mp2);
    12621262
     1263        //Save window that gains focus so we can determine which
     1264        //process we lose activation to
     1265        hwndFocusChange = (HWND)mp1;
     1266
    12631267        dprintf(("PMFRAME:WM_FOCUSCHANGE %x %x (%x) %x %x", win32wnd->getWindowHandle(), OS2ToWin32Handle(hwndFocus), hwndFocus, usSetFocus, fsFocusChange));
    12641268        goto RunDefFrameWndProc;
    12651269    }
    12661270
     1271#ifdef DEBUG
    12671272    case WM_SETFOCUS:
    12681273    {
     
    12851290                WinSendDlgItemMsg(hwnd, FID_TITLEBAR, TBM_SETHILITE, mp1, 0);
    12861291            }
    1287             WinSendDlgItemMsg(hwnd, FID_CLIENT, WM_ACTIVATE, mp1, mp2);
     1292            if(SHORT1FROMMP(mp1) == 0) {
     1293                //deactivate
     1294                WinSendDlgItemMsg(hwnd, FID_CLIENT, WM_ACTIVATE, mp1, mp2);
     1295            }
     1296            PID pidThis, pidPartner, pidTemp;
     1297            TID tidPartner;
     1298            HENUM henum;
     1299            HWND  hwndEnum;
     1300
     1301            WinQueryWindowProcess(hwnd, &pidThis, NULL);
     1302            WinQueryWindowProcess(hwndFocusChange, &pidPartner, &tidPartner);
     1303
     1304            if(pidThis != pidPartner) {
     1305                //Gain or lose activation to window in other process
     1306                //must send WM_ACTIVATEAPP to top-level windows
     1307
     1308                //Iterate over all child windows of the desktop
     1309                henum = WinBeginEnumWindows(HWND_DESKTOP);
     1310
     1311                while(hwndEnum = WinGetNextWindow(henum))
     1312                {
     1313                    WinQueryWindowProcess(hwndEnum, &pidTemp, NULL);
     1314                    if(pidTemp == pidThis)
     1315                    {
     1316                        SendMessageA(OS2ToWin32Handle(hwndEnum), WM_ACTIVATEAPP_W, (WPARAM)SHORT1FROMMP(mp1), (LPARAM)tidPartner);
     1317                    }
     1318                }
     1319                WinEndEnumWindows(henum);
     1320            }
     1321            if(SHORT1FROMMP(mp1)) {
     1322                //activate
     1323                WinSendDlgItemMsg(hwnd, FID_CLIENT, WM_ACTIVATE, mp1, mp2);
     1324            }
    12881325
    12891326            //CB: show owner behind the dialog
  • trunk/src/user32/win32wbase.cpp

    r7195 r7200  
    1 /* $Id: win32wbase.cpp,v 1.295 2001-10-24 15:41:54 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.296 2001-10-25 10:40:45 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    10011001    }
    10021002
    1003     rc = SendInternalMessageA(WM_ACTIVATE, MAKELONG((fActivate) ? WA_ACTIVE : WA_INACTIVE, fMinimized), hwnd);
    1004 
    1005     if(hwndOS2Win) {
    1006         threadidhwnd = O32_GetWindowThreadProcessId(hwndOS2Win, &procidhwnd);
    1007     }
    1008 
    1009     if(fActivate) {
    1010          SendInternalMessageA(WM_ACTIVATEAPP, 1, dwThreadId);    //activate; specify window thread id
    1011     }
    1012     else SendInternalMessageA(WM_ACTIVATEAPP, 0, threadidhwnd);  //deactivate; specify thread id of other process
    1013     return rc;
     1003    return SendInternalMessageA(WM_ACTIVATE, MAKELONG((fActivate) ? WA_ACTIVE : WA_INACTIVE, fMinimized), hwnd);
    10141004}
    10151005//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.