江
江上游者
Unregistered / Unconfirmed
GUEST, unregistred user!
library Library1;
uses
SysUtils,
Classes,
windows,
ShellApI;
//返回当前获得焦点的窗体
function GetFocusedWindowFromParent(ParentWnd:HWnd):HWnd;
var
OtherThread,
Buffer : DWord;
idCurrThread: DWord;
begin
OtherThread := GetWindowThreadProcessID(ParentWnd, @Buffer);//???错误总是在此行出现???????
idCurrThread := GetCurrentThreadID;
if AttachThreadInput(idCurrThread, OtherThread, true) then
begin
Result := GetFocus;
AttachThreadInput(idCurrThread, OtherThread, false);
end
else
Result:= GetFocus;
end;
function GetOpen(PFWnd:HWnd):HWnd;
begin
.....
.....
GetFocusedWindowFromParent(pf);
....
....
end;
exports
//GetFocusedWindowFromParent();//stdcall;//export;
GetOpen();stdcall;export;
begin
end.
uses
SysUtils,
Classes,
windows,
ShellApI;
//返回当前获得焦点的窗体
function GetFocusedWindowFromParent(ParentWnd:HWnd):HWnd;
var
OtherThread,
Buffer : DWord;
idCurrThread: DWord;
begin
OtherThread := GetWindowThreadProcessID(ParentWnd, @Buffer);//???错误总是在此行出现???????
idCurrThread := GetCurrentThreadID;
if AttachThreadInput(idCurrThread, OtherThread, true) then
begin
Result := GetFocus;
AttachThreadInput(idCurrThread, OtherThread, false);
end
else
Result:= GetFocus;
end;
function GetOpen(PFWnd:HWnd):HWnd;
begin
.....
.....
GetFocusedWindowFromParent(pf);
....
....
end;
exports
//GetFocusedWindowFromParent();//stdcall;//export;
GetOpen();stdcall;export;
begin
end.