//窗口置顶

SetWindowPos(Self.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE or SWP_NOMOVE);

 

//窗口启动后,不在任务栏显示窗口

//先在.dpr文件中改掉这句

Application.MainFormOnTaskbar := False;

//再在显示事件中

procedure TForm2.FormShow(Sender: TObject);
begin
  ShowWindow(Application.Handle, SW_HIDE);
end;

 

//delphi 2010设置任务栏窗口标题

Application.MainFormOnTaskbar := False;

Application.Title := '标题';

 

//窗口最小化,恢复,最大化消息处理

procedure WMSysCommand(var Message: TMessage); message WM_SYSCOMMAND;

 

procedure TFmClient.WMSysCommand(var Message: TMessage);
begin
case Message.WParam of
   SC_CLOSE:   ShowMessage('CLOSE'); // 点击关闭按钮
   SC_RESTORE: Showmessage('RESTORE');//点击恢复按扭
   SC_MAXIMIZE:Showmessage('MAXIMIZE');//点击最大化按扭
   SC_MINIMIZE:Showmessage('MINIMIZE');//点击最小化按扭
end;
// 此句不可少,为调用默认的消息处理方法。
inherited;
end;

posted on 2011-03-02 12:54  o无尘o  阅读(293)  评论(0编辑  收藏  举报