Ó¦¸Ã¿ÉÒԵģ¬·þÎñ³ÌÐòÒ²ÊÇÒ»ÖÖ¿ÉÖ´ÐÐÎļþ¶øÒÑ£¬°ïÄãÍÆÒ»ÏÂ
解决方案 »
- 连接oracle数据库,query查询都集成在一个dll里,请问在其他project用fastreport如何调用dll里的query查询制作报表?
- 请问这个SQL语句怎么写?
- tiff编辑
- 请指教
- 求助,如何用fastreport做动态报表?急!急!急!
- Delphi + sqlite + UniDAC 如何执行一次执行多条update语句?
- 如何连接access数据库
- Delphi中如何调用VB编的ActiveX控件?
- 怎样获取在DBgrid选中的cell或row的纵坐标--Top??
- 在动态库调用Datasnap函数,返回类型是TFDJSONDatasets报错The Input value is not a valid object
- 请问Application.Initialize、Application.CreateForm、Application.Run有什么用?请详细!
- 请问如何判断报表打印的页数?
为什么。
library hook;{ Important note about DLL memory management: ShareMem must be the
first unit in your library's USES clause AND your project's (select
Project-View Source) USES clause if your DLL exports any procedures or
functions that pass strings as parameters or function results. This
applies to all strings passed to and from your DLL--even those that
are nested in records and classes. ShareMem is the interface unit to
the BORLNDMM.DLL shared memory manager, which must be deployed along
with your DLL. To avoid using BORLNDMM.DLL, pass string information
using PChar or ShortString parameters. }uses
SysUtils,
windows,
messages,
Classes;{$R *.res}
var
thehook:hhook;
function winproc(iCode: Integer;wParam: WPARAM;lParam: LPARAM):integer;stdcall;
begin
Result := 0;
if getkeystate(vk_space)<0 then
begin
messagebox(0,'KBHook is running!','KBhook',mb_ok);
result:=1;
end
end;
procedure run();
begin
thehook:=setwindowshookex(WH_KEYBOARD,winproc,sysinit.HInstance,0);
end;procedure stop();
begin
unhookwindowshookex(thehook);
end;
exports
run,
stop;end.
运行马上就结束了,所以不行。修改Service程序的ServiceExecute过程:
procedure TService1.ServiceExecute(Sender: TService);
begin
run();
ServiceThread.ProcessRequests(True); //行直到用户停止Service。
stop();
end;
end.
function winproc(iCode: Integer;wParam: WPARAM;lParam: LPARAM):integer;stdcall;
begin
if iCode < 0 then
begin
Result := CallNextHookEx(thehook, iCode, wParam, lParam);
Exit;
end; Result := 0;
if getkeystate(vk_space)<0 then
begin
messagebox(0,'KBHook is running!','KBhook',mb_ok
+ MB_SERVICE_NOTIFICATION);
result := 1;
end;
end;
Interactive设成true。记住,需要先卸除原来的Service,再安装Service程
序才可以。