ActiveX pop-up dialogue window hides IE from tasklist

▼魔方 西西 提交于 2019-12-12 10:26:57

问题


This seems to only happen in IE6

I have an activex form written in Delphi 7. A dialogue window opened from within the activex control in IE6 gets displayed on the taskbar - the users (for some reason) do not want the dialogue to show in the taskbar.

So I set the dialogue's borderStyle to bsToolwindow. This hides the dialogue from the taskbar but also has the (side-) effect of hiding IE from the task list in windows, which means that you cannot <alt>Tab back to IE if you tabbed away.

Question: How to hide the activex pop-up dialogue from the taskbar but still have IE6 listed in the tasklist?


回答1:


Set the owner window of your form to be the activex form (or perhaps the ie window). You can achieve this f.i. by passing the activex form as the owner component while you're creating your form and overriding CreateParams of the instantiated form:

// in the activex form's unit
procedure TActiveFormX.Button1Click(Sender: TObject);
var
  f: TForm;
begin
  f := TForm1.Create(Self);
  f.BorderStyle := bsToolWindow;
  f.Show;
end;

// in the dialog unit
type
  TForm1 = class(TForm)
  private
  protected
    procedure CreateParams(var Params: TCreateParams); override;
  [...]

[...]
procedure TForm1.CreateParams(var Params: TCreateParams);
begin
  inherited;
  Params.WndParent := TCustomForm(Owner).Handle;
end;


来源:https://stackoverflow.com/questions/5016683/activex-pop-up-dialogue-window-hides-ie-from-tasklist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!