SiWeiLiuLang进来!!!!! 找仓库进销存管理
2楼: 楼主你好
hkey是哪里的类呢? 如财务软件免费版下载
3楼: 是这样的 在动态连接库中的
function newRegCreateKeyA(hKey: HKEY; lpSubKey: PAnsiChar;
var phkResult: HKEY): Longint; stdcall;
type
TRegCreateKeyA=function(hKey: HKEY; lpSubKey: PAnsiChar;
var phkResult: HKEY): Longint; stdcall;
begin
hook[fRegCreateKeyA].Restore;
end;
编译后出现那个错误
4楼: 错误类型hkey" is not a type identifier
5楼: 稍等
6楼: 好的
记账软件版7楼: http://download.pchome.net/article/2002/09/25/38.htm
看看先
8楼: 这里面没有啊 其他都能操作 就是hkey找不到类型标识符
9楼: type
HKEY = Longint;
10楼: 在文件首 就是use下声明不起作用
11楼: 该在什么地方声明这个呢?
12楼: unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls;
type
HKey = LongWord;
TForm1 = class(TForm)
ListView1: TListView;
private
{ Private declarations }
public 如企业档案管理软件
13楼: HKEY是哪里来的呢?
记账软件版14楼: 系统没这个东西
15楼: for Avalon 实在抱歉 还是不行 可能是本人太愚
16楼: 你用的delphi版本是多少 delphi7 SP2 hkey是定义好的
17楼: hkey在windows.pas中是有的 但是编译就错 郁闷啊 不过谢谢你的帮助
18楼: 我晕 那该怎么办? 不会吧
19楼: 我是正宗的delphi7.0 没有打任何补丁的
20楼: 那USes 了windows.pas没?
或者,根本就是类的问题
记账软件版21楼: use 了 不行啊
22楼: 估计你看错名字了
[:D][:D] 如仓库进销存管理
23楼: 我把源代码贴出来吧
unit UnitHookDll;
interface
uses Windows,SysUtils, Registry,Classes, math, messages, dialogs, UnitNt2000Hook,
UnitHookType;
type
HKey = LongWord;
const
COLOR1=255;
COLOR2=0;
COLOR3=255;
Trap=true; //True陷阱式,False表示改引入表式
procedure StartHook; stdcall; {开始取词}
procedure StopHook; stdcall; {停止取词}
implementation
function newRegCreateKeyA(hKey: HKEY; lpSubKey: PAnsiChar;
var phkResult: HKEY): Longint; stdcall;
type
TRegCreateKeyA=function(hKey: HKEY; lpSubKey: PAnsiChar;
var phkResult: HKEY): Longint; stdcall;
begin
hook[fRegCreateKeyA].Restore;
end;
procedure StartHook; stdcall;
begin
if MouseHook1=0 then
begin
MouseHook1 := SetWindowsHookEx(WH_getmessage, GetMsgProc, HInstance, 0);
end;
end;
procedure StopHook; stdcall;
begin
if MouseHook1<>0 then
begin
UnhookWindowsHookEx(MouseHook1);
MouseHook1:=0;
SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0);
end;
end;
24楼: 你吧HKEY替换为longint算了
25楼: 那样会出现更多错误的 谢谢你们这么热心的帮助
看来这次是失败了!
26楼: 问题应是这样:
1、你记错了单元名
2、单元里的定义有问题
3、见鬼了
27楼: 3 好了 我结贴了 谢谢了
记账软件版28楼: 接受答案了.