1.在窗启动时创建ATOM;(aatom:ATOM;定义在private中) then begin aatom:=GlobalAddAtom('ZWXhotKey'); end; ) then begin MessageBox(Handle,'按alt+a','提示',MB_OK); end; 2.定义处理热键的消息过程(定义在private中,下面二个处理消息的过程是一样的) procedure hotkey(var msg:TMessage);message WM_HOTKEY;//定义全局
uses windows,menus; ..... //声明 HotKey_Key: Word; HotKey_Shift: Word; procedure WMHotKey(var msg : Tmessage); message WM_HOTKEY; ...... function ShiftStateToWord(Shift:TShiftState): Word; begin if ssShift in Shift then Result :=MOD_SHIFT else Result :
procedure TForm1.btnChangePixelClick(Sender: TObject); var baseX : integer ; baseY : integer ; i,j : integer; c : TCanvas; begin baseX :=100; baseY := 100; c := TCanvas.create; try c.Handle := GetDC(0); for i := baseX - 1 to baseX + 1 do begin for j