qq 的 多模态窗体是怎么实现的? 多个聊天窗口分别有自己的 发送文件 对话框。(100分)

  • 主题发起人 主题发起人 chenxiaohan
  • 开始时间 开始时间
C

chenxiaohan

Unregistered / Unconfirmed
GUEST, unregistred user!
qq 的 多模态窗体是怎么实现的? 多个聊天窗口分别有自己的 发送文件 对话框。

与A聊天时,打开 发送文件 对话框,
与B聊天时,打开 发送文件 对话框,
这两个窗口可以自由切换,切换时,对应的 发送文件。
这个应该不是Showmodal 出来的,请问怎么实现的??
 
我问过这个问题在写UU的时候。已经解决。代码如下。记得给分啊
unit intask2;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, TB2MDI;

type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
procedure Createparams(var params: TCreateParams); override;
procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND;
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

uses intask;

{$R *.dfm}

{ TForm1 }

procedure TForm1.Createparams(var params: TCreateParams);
begin
inherited CreateParams(Params);
Params.ExStyle := WS_EX_APPWINDOW;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
with Tform2.Create(self) do show;
end;

procedure TForm1.FormActivate(Sender: TObject);
begin
beep;
showWindow(application.Handle,SW_HIDE);
end;

procedure TForm1.WMSysCommand(var Message: TWMSysCommand);
begin
with Message do
begin
beep;
if (CmdType and $FFF0 = SC_MINIMIZE) and (Application.MainForm = Self) then
self.WindowState:=WsMinimized// Application.WndProc(TMessage(Message))
else if (CmdType and $FFF0 <> SC_MOVE) or (csDesigning in ComponentState) or
(Align = alNone) or (WindowState = wsMinimized) then
inherited;
if ((CmdType and $FFF0 = SC_MINIMIZE) or (CmdType and $FFF0 = SC_RESTORE)) and
not (csDesigning in ComponentState) and (Align <> alNone) then
RequestAlign;
end;

end;

end.

*************************
unit intask;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm2 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
procedure Createparams(var params: TCreateParams); override;
public
{ Public declarations }
end;

var
Form2: TForm2;

implementation

{$R *.dfm}

{ TForm2 }

procedure TForm2.Createparams(var params: TCreateParams);
begin
inherited CreateParams(Params);
Params.ExStyle := WS_EX_APPWINDOW;
end;

procedure TForm2.Button1Click(Sender: TObject);
begin
showmessage('dsdfsdfs');
end;

end.
 
后退
顶部