Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Hook keyboard event in word com addin

Hook keyboard event in word com addin

Scheduled Pinned Locked Moved Visual Basic
comquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vancouver777
    wrote on last edited by
    #1

    Is there any way to hook keyboard input as wl as mouse clicking event? Word.Application object has an event called WindowBeforeDoubleClick I am looking for similar event for keyboard. I am trying to find a way to enable a toolbar button when active document is modified. Van

    H 1 Reply Last reply
    0
    • V vancouver777

      Is there any way to hook keyboard input as wl as mouse clicking event? Word.Application object has an event called WindowBeforeDoubleClick I am looking for similar event for keyboard. I am trying to find a way to enable a toolbar button when active document is modified. Van

      H Offline
      H Offline
      Hadi Fakhreddine
      wrote on last edited by
      #2

      As i understand, you want to keep track of every keyboard action the user performs in the word document? You can always implement a local hook on the word document thread using any of the classes available here: http://www.codeproject.com/csharp/NetWin32Hooks.asp or here http://www.codeproject.com/csharp/GlobalSystemHook.asp The rest of the work you have to do is first get fmailiar with these classes (maybe you already are) and second you'd have to get the ThreadID of the desired word-document window...I know a way to do this by using the Win32 API call for FindWindowEx...you simply have to specify the name of the window (in your case "Word" and it will return the hWnd...just stick that hWnd instance to the above classes and you're hooked to the word thread :-D Let me know what happens ;)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups