Changeset 5863 for trunk/src


Ignore:
Timestamp:
Jun 1, 2001, 12:28:17 PM (24 years ago)
Author:
sandervl
Message:

disabled global system hooks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/HOOK.CPP

    r5606 r5863  
    1 /* $Id: HOOK.CPP,v 1.18 2001-04-27 17:36:36 sandervl Exp $ */
     1/* $Id: HOOK.CPP,v 1.19 2001-06-01 10:28:17 sandervl Exp $ */
    22
    33/*
     
    4545#include <wprocess.h>
    4646
     47#include "win32wbase.h"
     48
    4749#define DBG_LOCALLOG    DBG_hook
    4850#include "dbglocal.h"
     
    8385
    8486//Global DLL Data
    85 #pragma data_seg(_GLOBALDATA)
     87//SvL: Disabled global system hooks for now
     88////#pragma data_seg(_GLOBALDATA)
    8689static HANDLE HOOK_systemHooks[WH_NB_HOOKS] = { 0 };
    8790static VMutex systemHookMutex(VMUTEX_SHARED, &hGlobalHookMutex);
    88 #pragma data_seg()
     91////#pragma data_seg()
    8992static HANDLE HOOK_threadHooks[WH_NB_HOOKS] = { 0 };
    9093static VMutex threadHookMutex;
     
    742745}
    743746
     747BOOL IsMenuActive(void);
    744748
    745749BOOL ProcessKbdHook(LPMSG msg, BOOL remove )
    746750{
     751    /* Handle F1 key by sending out WM_HELP message */
     752    if ((msg->message == WM_KEYUP) &&
     753        (msg->wParam == VK_F1) &&
     754        remove &&
     755        (msg->hwnd != GetDesktopWindow()) &&
     756        !IsMenuActive())
     757    {   
     758        HELPINFO hi;
     759        Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle(msg->hwnd);
     760
     761        if (NULL != wnd)
     762        {
     763            hi.cbSize = sizeof(HELPINFO);
     764            hi.iContextType = HELPINFO_WINDOW;
     765            hi.iCtrlId = wnd->getWindowId();
     766            hi.hItemHandle = msg->hwnd;
     767            hi.dwContextId = wnd->getWindowContextHelpId();
     768            hi.MousePos = msg->pt;
     769            SendMessageA(msg->hwnd, WM_HELP, 0, (LPARAM)&hi);
     770        }
     771    }
     772
    747773    return (HOOK_CallHooksA( WH_KEYBOARD, remove ? HC_ACTION : HC_NOREMOVE,
    748774                             LOWORD (msg->wParam), msg->lParam )
Note: See TracChangeset for help on using the changeset viewer.