我用Delphi写了一个登陆窗体,然后再写进了DLL里面,我用delphi把Dll注入了游戏里面。在游戏里可以呼出,但是登陆功能就不能实现了。提示异常,我用的是MSSQL数据库。请高手帮忙分析下原因。//===========接收按键F12开呼出隐藏窗口==================
function HookProc(nCode:Integer;WParam: WPARAM;LParam:LPARAM):LRESULT;stdcall;
label
theExit;
begin
if nCode < 0 then
goto theExit;
if (nCode <> HC_ACTION) then
goto theExit;
if ((lParam and $80000000) = 0) { or (GetAsyncKeyState(VK_Control)=0) } then
goto theExit;
case wParam of VK_F12:
begin
if frmLogin <> nil then
begin
if frmLogin.Visible = true then
frmLogin.Hide
else
begin
frmLogin.Show;
end;
end
else //窗体还没有加载
frmLogin:=TfrmLogin.Create(Application);
end;
end;
theExit:
result := CallNextHookEx(hHk, nCode, wParam, lParam);
end;
function HookProc(nCode:Integer;WParam: WPARAM;LParam:LPARAM):LRESULT;stdcall;
label
theExit;
begin
if nCode < 0 then
goto theExit;
if (nCode <> HC_ACTION) then
goto theExit;
if ((lParam and $80000000) = 0) { or (GetAsyncKeyState(VK_Control)=0) } then
goto theExit;
case wParam of VK_F12:
begin
if frmLogin <> nil then
begin
if frmLogin.Visible = true then
frmLogin.Hide
else
begin
frmLogin.Show;
end;
end
else //窗体还没有加载
frmLogin:=TfrmLogin.Create(Application);
end;
end;
theExit:
result := CallNextHookEx(hHk, nCode, wParam, lParam);
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货