Ignore:
Timestamp:
Oct 22, 2003, 2:43:14 PM (22 years ago)
Author:
sandervl
Message:

Use WC_FRAME for the Odin frame window and subclass it; Updates for new keyboard hook

File:
1 edited

Legend:

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

    r10276 r10284  
    1 /* $Id: pmwindow.cpp,v 1.221 2003-10-20 17:18:14 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.222 2003-10-22 12:43:14 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    8181BOOL    fDragDropDisabled = FALSE;
    8282
    83 char WIN32_CDCLASS[255]       = "Win32CDWindowClass";
    84 char WIN32_STDCLASS[255]      = "Win32WindowClass";
    85 char WIN32_STDFRAMECLASS[255] = "Win32FrameClass";
     83const char WIN32_CDCLASS[]       = "Win32CDWindowClass";
     84      char WIN32_STDCLASS[255]   = "Win32WindowClass";
    8685
    8786#define PMMENU_MINBUTTON           0
     
    106105HBITMAP hBmpCloseButtonDown   = 0;
    107106
    108 static PFNWP pfnFrameWndProc = NULL;
     107      PFNWP pfnFrameWndProc = NULL;
    109108static HWND  hwndFocusChange = 0;
    110109       HWND  hwndCD = 0;
     
    215214    }
    216215
     216    //We no longer register our own frame window class as there is code in PM
     217    //that makes assumptions about frame window class names.
     218    //Instead we subclass the frame window right after creating it.
    217219    CLASSINFO FrameClassInfo;
    218220    if(!WinQueryClassInfo (hab, WC_FRAME, &FrameClassInfo)) {
     
    223225
    224226    dprintf(("WC_FRAME style %x", FrameClassInfo.flClassStyle));
    225 
    226     // this is our OS/2 window class for frame windows
    227     if(!WinRegisterClass(                 /* Register window class        */
    228         hab,                               /* Anchor block handle          */
    229         (PSZ)WIN32_STDFRAMECLASS,          /* Window class name            */
    230         (PFNWP)Win32FrameWindowProc,       /* Address of window procedure  */
    231         CS_FRAME,
    232         FrameClassInfo.cbWindowData))
    233     {
    234         dprintf(("WinRegisterClass Win32BaseWindow failed %x", WinGetLastError(hab)));
    235         return(FALSE);
    236     }
    237227
    238228    // get the screen dimensions and store them
     
    506496 POSTMSG_PACKET  *postmsg;
    507497 OSLIBPOINT       point, ClientPoint;
    508 
     498 EXCEPTIONREGISTRATIONRECORD exceptRegRec = {0,0};
     499
     500    ODIN_SetExceptionHandler(&exceptRegRec);
    509501    // restore our FS selector
    510502    SetWin32TIB();
     
    583575        RELEASE_WNDOBJ(win32wnd);
    584576        RestoreOS2TIB();
     577        ODIN_UnsetExceptionHandler(&exceptRegRec);
    585578
    586579#ifdef DEBUG
     
    11551148    if(win32wnd) RELEASE_WNDOBJ(win32wnd);
    11561149    RestoreOS2TIB();
     1150    ODIN_UnsetExceptionHandler(&exceptRegRec);
    11571151
    11581152#ifdef DEBUG
     
    11661160
    11671161    RestoreOS2TIB();
     1162    ODIN_UnsetExceptionHandler(&exceptRegRec);
    11681163
    11691164#ifdef DEBUG
     
    11821177 MRESULT          rc = 0;
    11831178 MSG              winMsg, *pWinMsg;
     1179 EXCEPTIONREGISTRATIONRECORD exceptRegRec = {0,0};
    11841180
    11851181#ifdef DEBUG
     
    11871183#endif
    11881184
     1185    ODIN_SetExceptionHandler(&exceptRegRec);
    11891186    //Restore our FS selector
    11901187    SetWin32TIB();
     
    21722169    if(win32wnd) RELEASE_WNDOBJ(win32wnd);
    21732170    RestoreOS2TIB();
     2171    ODIN_UnsetExceptionHandler(&exceptRegRec);
    21742172
    21752173#ifdef DEBUG
     
    21822180    if(win32wnd) RELEASE_WNDOBJ(win32wnd);
    21832181    RestoreOS2TIB();
     2182    ODIN_UnsetExceptionHandler(&exceptRegRec);
    21842183
    21852184#ifdef DEBUG
     
    21922191    if(win32wnd) RELEASE_WNDOBJ(win32wnd);
    21932192    RestoreOS2TIB();
     2193    ODIN_UnsetExceptionHandler(&exceptRegRec);
    21942194
    21952195    //calling WinDefWindowProc here breaks Opera hotlist window (WM_ADJUSTWINDOWPOS)
     
    22292229    rc = pfnOldWindowProc(hwnd, msg, mp1, mp2);
    22302230
     2231    ODIN_SetExceptionHandler(&exceptRegRec);
    22312232    SetWin32TIB();
    22322233    switch(msg) {
     
    22502251    if(win32wnd) RELEASE_WNDOBJ(win32wnd);
    22512252    RestoreOS2TIB();
     2253    ODIN_UnsetExceptionHandler(&exceptRegRec);
    22522254    return rc;
    22532255
     
    24642466}
    24652467
    2466 // @@PF Three funcs to override std class names we use in Odin
    2467 //******************************************************************************
    2468 //******************************************************************************
    2469 void WIN32API SetCustomCDClassName(LPSTR pszCDClassName)
    2470 {
    2471    strcpy(WIN32_CDCLASS, pszCDClassName);
    2472 }
    2473 //******************************************************************************
     2468//******************************************************************************
     2469// Override std class names we use in Odin (necessary for keyboard hook)
    24742470//******************************************************************************
    24752471void WIN32API SetCustomStdClassName(LPSTR pszStdClassName)
    24762472{
    24772473   strcpy(WIN32_STDCLASS, pszStdClassName);
    2478 }
    2479 //******************************************************************************
    2480 //******************************************************************************
    2481 void WIN32API SetCustomStdFrameClassName(LPSTR pszStdFrameClassName)
    2482 {
    2483    strcpy(WIN32_STDFRAMECLASS, pszStdFrameClassName);
    24842474}
    24852475//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.