主窗体调用dll里的子窗体.
点击Form1的Button后弹出了Form2, Form2必须用SetWindowPos()置顶,但这时Form1
被置灰了(好象是失去焦点吧),怎么才能让Form1也处于激活状态.帮帮忙
mydll.dll
------------------------------------------------------------------------------
function HookProc(nCode:Integer; WParam:WPARAM; LParam:LPARAM):LRESULT;stdcall;
begin
..............
..............
Form1:=TForm1.Create(Application);
ShowCursor(true);
SetWindowPos(Form1.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE);
finally
Form1.Free;
end;
------------------------------------------------------------------------------
点击Form1的Button后弹出了Form2, Form2必须用SetWindowPos()置顶,但这时Form1
被置灰了(好象是失去焦点吧),怎么才能让Form1也处于激活状态.帮帮忙
mydll.dll
------------------------------------------------------------------------------
function HookProc(nCode:Integer; WParam:WPARAM; LParam:LPARAM):LRESULT;stdcall;
begin
..............
..............
Form1:=TForm1.Create(Application);
ShowCursor(true);
SetWindowPos(Form1.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE);
finally
Form1.Free;
end;
------------------------------------------------------------------------------
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货