Changeset 1093 for trunk/src


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

WM_ACTIVATE(APP) changes

Location:
trunk/src/user32
Files:
5 edited

Legend:

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

    r1082 r1093  
    1 /* $Id: pmwindow.cpp,v 1.11 1999-09-28 13:27:35 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.12 1999-09-29 09:16:31 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    379379    case WM_ACTIVATE:
    380380    {
    381       HWND hwndActivate = (HWND)mp1;
    382 
    383         dprintf(("OS2: WM_ACTIVATE %x", hwnd));
     381      HWND hwndActivate = (HWND)mp2;
     382      BOOL fMinimized = FALSE;
     383
     384        dprintf(("OS2: WM_ACTIVATE %x %x", hwnd, hwndActivate));
    384385        if(WinQueryWindowULong(hwndActivate, OFFSET_WIN32PM_MAGIC) != WIN32PM_MAGIC) {
    385386                //another (non-win32) application's window
     
    387388                hwndActivate = NULL;
    388389        }
    389         if(win32wnd->MsgActivate(1, hwndActivate)) {
     390        if(WinQueryWindowULong(hwnd, QWL_STYLE) & WS_MINIMIZED)
     391        {
     392           fMinimized = TRUE;
     393        }
     394
     395        if(win32wnd->MsgActivate(SHORT1FROMMP(mp1), fMinimized, Win32BaseWindow::OS2ToWin32Handle(hwndActivate))) {
    390396                goto RunDefWndProc;
    391397        }
     
    407413        }
    408414        if((ULONG)mp2 == TRUE) {
    409                 rc = win32wnd->MsgSetFocus(hwndFocus);
    410         }
    411         else    rc = win32wnd->MsgKillFocus(hwndFocus);
     415                rc = win32wnd->MsgSetFocus(Win32BaseWindow::OS2ToWin32Handle(hwndFocus));
     416        }
     417        else    rc = win32wnd->MsgKillFocus(Win32BaseWindow::OS2ToWin32Handle(hwndFocus));
    412418        if(rc) {
    413419                goto RunDefWndProc;
  • 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//******************************************************************************
  • trunk/src/user32/win32wbase.h

    r1091 r1093  
    1 /* $Id: win32wbase.h,v 1.9 1999-09-29 08:27:16 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.10 1999-09-29 09:16:32 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    7272         ULONG  MsgHitTest(ULONG x, ULONG y);
    7373         ULONG  MsgSize(ULONG width, ULONG height, BOOL fMinimize, BOOL fMaximize);
    74          ULONG  MsgActivate(BOOL fActivate, HWND hwnd);
     74virtual  ULONG  MsgActivate(BOOL fActivate, BOOL fMinimized, HWND hwnd);
    7575         ULONG  MsgSetFocus(HWND hwnd);
    7676         ULONG  MsgKillFocus(HWND hwnd);
  • trunk/src/user32/win32wmdichild.cpp

    r949 r1093  
    1 /* $Id: win32wmdichild.cpp,v 1.1 1999-09-15 23:19:01 sandervl Exp $ */
     1/* $Id: win32wmdichild.cpp,v 1.2 1999-09-29 09:16:32 sandervl Exp $ */
    22/*
    33 * Win32 MDI Child Window Class for OS/2
     
    5555//******************************************************************************
    5656//******************************************************************************
     57ULONG Win32MDIChildWindow::MsgActivate(BOOL fActivate, BOOL fMinimized, HWND hwnd)
     58{
     59 ULONG rc, curprocid, procidhwnd = -1, threadidhwnd = 0;
     60
     61    //According to SDK docs, if app returns FALSE & window is being deactivated,
     62    //default processing is cancelled
     63    //TODO: According to Wine we should proceed anyway if window is sysmodal
     64    if(SendInternalMessageA(WM_NCACTIVATE, fActivate, 0) == FALSE && !fActivate)
     65    {
     66        return 0;
     67    }
     68    if(fActivate)
     69    {
     70         rc = SendInternalMessageA(WM_CHILDACTIVATE, MAKELONG((fActivate) ? WA_ACTIVE : WA_INACTIVE, fMinimized), hwnd);
     71         curprocid  = GetCurrentProcessId();
     72         if(hwnd) {
     73                threadidhwnd = GetWindowThreadProcessId(hwnd, &procidhwnd);
     74         }
     75
     76         if(curprocid != procidhwnd && fActivate) {
     77            SendInternalMessageA(WM_ACTIVATEAPP, 1, threadidhwnd);
     78         }
     79         return rc;
     80    }
     81    else return 1;
     82}
     83//******************************************************************************
     84//******************************************************************************
    5785LRESULT Win32MDIChildWindow::DefMDIChildProcA(UINT Msg, WPARAM wParam, LPARAM lParam)
    5886{
  • trunk/src/user32/win32wmdichild.h

    r949 r1093  
    1 /* $Id: win32wmdichild.h,v 1.1 1999-09-15 23:19:01 sandervl Exp $ */
     1/* $Id: win32wmdichild.h,v 1.2 1999-09-29 09:16:32 sandervl Exp $ */
    22/*
    33 * Win32 MDI Client Window Class for OS/2
     
    2424virtual        ~Win32MDIChildWindow();
    2525
     26virtual  ULONG  MsgActivate(BOOL fActivate, BOOL fMinimized, HWND hwnd);
     27
    2628   static HWND  createChild(Win32MDIClientWindow *client, LPMDICREATESTRUCTA cs);
    2729           void childGetMinMaxInfo(MINMAXINFO* lpMinMax);
Note: See TracChangeset for help on using the changeset viewer.