本人前段时间写了个键盘Hook,但无法返回所截获的按键,哪位高手能帮忙解决一下?(仅在内存内完成,不将返回的内容写进文件或注册表)

解决方案 »

  1.   

    http://www.codeproject.com/dll/keyboardhook.asp
    This will help u
      

  2.   

    http://www.codeproject.com/dll/keyboardhook.asp
    This will help u
      

  3.   

    Oh,I think I had not expressed my question clearly.
    I've written a keyboard hook.
    I use a program which was written in another language to invoke it.
    I passed the handle of my window as value.
    And I passed the buffer which was used to receive the return values as a pointer.
    The problem was that the handle passed to the hook function successfully ,but the buffer's pointer couldn't pass to the hook function. So I can tell my window the message but my window can't read the values from the buffer.
    I had declared the handle and the pointer at the front of all functions in the .cpp(the installhook function and the hook function are in the same .cpp file) or even in the head file.
    And the VC 6.0 had display that they were all global !
    Why can't a pointer be passed while a value can?
      

  4.   

    我的做法是,在dll中把截获的按键写道一个文件中,然后再在其他程序中度出来.