我试了setwindowlong;不知是否没用对,打开DLL窗体再关闭,主窗体在任务栏上的标签就失效了。
我是这样写的代码:在DLL中
openform(ahandle:THandle);
begin
application.handle:=ahandle//ahandle是主程序的HANDLE,在主程序中
//这样调用的:openform(application.handle);
dllform:=tform1.create;
dllform.showmodal;//在dllform的create事件中又用了setwindowlong函数
dllform.free;
end;experts
openform;
begin
end.
希望得到更好的有效的方法。
我是这样写的代码:在DLL中
openform(ahandle:THandle);
begin
application.handle:=ahandle//ahandle是主程序的HANDLE,在主程序中
//这样调用的:openform(application.handle);
dllform:=tform1.create;
dllform.showmodal;//在dllform的create事件中又用了setwindowlong函数
dllform.free;
end;experts
openform;
begin
end.
希望得到更好的有效的方法。
protected
procedure CreateParams(var Params: TCreateParams); override;//避免子窗体在任务栏出现
procedure TfrmUserPdSt.CreateParams(var Params: TCreateParams);
begin
inherited;
Params.ExStyle := Params.ExStyle or WS_EX_TOOLWINDOW;
end;方法2
SetWindowLong(Application.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
一個是指主程序的handle, 一個是指本窗口的handle
begin
application.handle:=ahandle//ahandle是主程序的HANDLE,在主程序中
//这样调用的:openform(application.handle);
dllform:=tform1.create(application);
dllform.showmodal;//在dllform的create事件中又用了setwindowlong函数
dllform.free;
end;
begin
application.handle:=ahandle//ahandle是主程序的HANDLE,在主程序中
//这样调用的:openform(application.handle);
dllform:=Application.createform(TForm1,DllForm) //tform1.create(application);
dllform.showmodal;//在dllform的create事件中又用了setwindowlong函数
dllform.free;
end;