随笔分类 - Delphi
Delphi
摘要:1.安装勾子用SetWindowsHookEx function来实现,对于这个函数先来看MSDN解释Installs an application-defined hook procedure into a hook chain. You would install a hook procedure to monitor the system for certain types of events. These events are associated either with a specific thread or with all threads in the same desktop
阅读全文
摘要:首先要获得设备环境的句柄,可以通过GetDC函数来获得,对于这个函数,MSDN上是这样说明的The GetDC function retrieves a handle to a device context (DC) for the client area of a specified window or for the entire screen. You can use the returned handle in subsequent GDI functions to draw in the DC. The device context is an opaque data struc..
阅读全文
摘要:1.在窗启动时创建ATOM;(aatom:ATOM;定义在private中)1 if FindAtom('ZWXhotKey')=0 then2 begin3 aatom:=GlobalAddAtom('ZWXhotKey');4 end;5 if RegisterHotKey(Handle,aatom,MOD_ALT,$41) then6 begin7 MessageBox(Handle,'按alt+a','提示',MB_OK);8 end;2.定义处理热键的消息过程(定义在private中,下面二个处理消息的过程是一样的)1
阅读全文

浙公网安备 33010602011771号