procedure AppOnMessage(var Msg: TMsg; var Handled: Boolean);
procedure Tfmformname.AppOnMessage(var Msg: TMsg; var Handled: Boolean);
var
a:Cardinal;
i: SmallInt;
WMD: TWMDropFiles;
buf :array[0..254] of Char;
begin
if (Msg.message = WM_KEYDOWN) then
begin
//CTRL+S: tig TEjunTreeGrid会相应这个消息, 让当前单元格处于全选编辑状态, 很蛋疼, 所以再次拦截消息
if (GetKeyState(VK_CONTROL)<0) and (Msg.wParam=ord('S')) THEN
begin
。。。。
end ELSE
//为防止误操作,禁止热键Ctrl+左右方向键 进行升级 降级 操作
if (GetKeyState(VK_CONTROL)<0) and ((Msg.wParam=VK_LEFT) or (Msg.wParam=VK_RIGHT)) THEN
begin
Handled:= true;
end else
//CTRL+F: 查找
if (GetKeyState(VK_CONTROL)<0) and (Msg.wParam=ord('F')) then
begin
cbx_key.SetFocus;
cbx_key.SelectAll;
Handled:= true;
END else
//F3: 下一个(仅对当前查找有效)
if (GetKeyState(VK_CONTROL)>=0) and (Msg.wParam=VK_F3) then
begin
FindNextEx();
Handled:= true;
//G.Log.WriteAppLog('F3: 下一个...', G.MainHanlde);
END;
end;
end;
procedure Tfm2fmname.FormCreate(Sender: TObject);
begin
Application.OnMessage:= AppOnMessage;