目的:把vncserver从exe封装成dll,然后通过.NET程序提供的用户界面予以调用。环境:VNC Free Edition 4.1 + .NET 2.0。结果:为了实现定制地Disable Remote Input,在WH_KEYBOARD_LL的使用上出了点小问题。This hook is called in the context of the thread that installed it. The call is made by sending a message to the thread that installed the hook. Therefore, the thread that installed the hook must have a message loop. 我在消息循环里加了一个Sleep,导致程序行为异常,好一顿找。