可以屏蔽所有窗口下F9-F12这几个按键盘。不管你的程序是否运行在当前窗口都可以屏蔽的。而且适合所有的WINDOWS操作系统

解决方案 »

  1.   

    那只能用 SetWindowsHookEx 了,挂一个键盘钩子,吃掉 F9 - F12 的所有消息
    如果只屏蔽自身程序的F9 - F12,就好弄些啦,如果想屏蔽整个系统下的F9 - F12,就必须再写一个简单的动态链接库(DLL),因为操作系统的内存管理机制问题,有些功能只能在DLL里才能实现。
      

  2.   

    You cannot do that using VB. If you want to install a global hook using 
    SetWindowsHookEx, your hook procedure must be in a DLL while VB6 cannot be 
    used to make normal DLLs. This fact is documented in the following 
    article.(mouse hook and keyboard hook are similar) Q177992 HOWTO: Intercept Keyboard Input from Visual Basic 
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q177992 
    ================= 
    It is possible to intercept all of the keyboard input from all of the 
    applications running on a system, but not using "pure" Visual Basic. The 
    hook must be placed in a standard DLL; while Visual Basic can create OLE 
    DLLs, it cannot create standard DLLs. 
    ================= 
    You need use a tool which can be used to make standard DLLs to write the 
    hook procedure, such as VC. Global hooks are not supported in the .NET Framework
    You cannot implement global hooks in Microsoft .NET Framework. To install a global hook, a hook must have a native DLL export to insert itself in another process that requires a valid, consistent function to call into. This behavior requires a DLL export. The .NET Framework does not support DLL exports. Managed code has no concept of a consistent value for a function pointer because these function pointers are proxies that are built dynamically.
      

  3.   

    那只能用 SetWindowsHookEx 了,挂一个键盘钩子,吃掉 F9 - F12 的所有消息
    如果只屏蔽自身程序的F9 - F12,就好弄些啦,如果想屏蔽整个系统下的F9 - F12,就必须再写一个简单的动态链接库(DLL),因为操作系统的内存管理机制问题,有些功能只能在DLL里才能实现。
    ------------------
    同意一楼的观点!
      

  4.   

    jiangsheng(蒋晟.Net[MVP]) 也是同样的意思!
      

  5.   

    SetWindowsHookEx
    有没有类似的代码给我看一下
      

  6.   

    貌似挂钩替换link.exe,可以做标准dll
      

  7.   

    楼上的说法。我不太明白。您能加下我QQ吗? 我QQ是 91270