.如何做出像东方快车,金山快译那样没有标题栏,没有最大,最小,关闭按钮,却可以随意移动,谢谢。
解决方案 »
- 我记得可以用API时间FORM颜色渐变地效果,不知道谁知道,谢谢
- 下面语句为什么运行不能通过呀?
- 变量如何套用公式的问题,有点急!!
- 一个简单而很深深的问题?
- vc的dll中函数里需要外部给一个十六进制的int数(比如0x1,0x2)delphi调用时我给了$01,$02,非法操作,why?
- 怎么实现将一个表中Text类型字段导入到另一个表的中的Text字段
- 郁闷,delphi把ado使用改的用不来了
- 我有一个SQL Server 的语名,要在MySQL下运行,如何改????
- 超级简单Indy新手问题,各位请进~~~
- 请问INFOPOWER能安装上delphi6?
- 求救,vc和delohi的高手!
- TreeList配置一个PopMenu,如何设置,使得只有在点击Item的时候才弹出此Menu
var
pt:TPoint;
begin
inherited;
pt:=Point(Msg.xPos,Msg.yPos);
pt:=ScreenToClient(pt);
if (Msg.result = HTCLIENT) and (pt.Y <= 25) then Msg.Result := HTCAPTION;
end;
procedure TForm1.WMLButtonDown(var Msg:TMessage);
begin
SendMessage(Application.MainForm.Handle,WM_NCLButtonDown,HTCaption,0);
Click;
end;
procedure TForm1.CMMouseLeave(var Msg:TMessage);
begin
inherited;
if not Form1.Focused then
Form1.Width := 2
end;
你试一试
TYPE
procedure WMNCHitTest(var M: TWMNCHitTest); message wm_NCHitTest;
........
实现部分
procedure TForm1.WMNCHitTest(var M: TWMNCHitTest);
begin
inherited; { 调用默认的事件处理程序 }
if M.Result = htClient then M.Result := htCaption;
{如果是在Client区让Windows认为是在Caption区 }
end;
然后在MOUSEDOWN事件中加入代码
代码为当鼠标按下时向WINDOWS送出标题栏被按下的消息就可以了
具体代码看一看API就知道了
当你鼠标离开界面时,那个界面就会自动变小,这个就是那个程序其中一段代码(delphi)
给分吧
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
procedure WMNChit(var msg:TWMNChitTest);
Message WM_NChitTest;
public
procedure CreateParams(var Params:TCreateParams);override;
end;var
Form1: TForm1;implementation{$R *.DFM}{ TForm1 }procedure TForm1.CreateParams(var Params: TCreateParams);
begin
inherited;
params.Style:=(params.Style or Ws_popup) and not ws_caption;
end;procedure TForm1.WMNChit(var msg: TWMNChitTest);
begin
inherited;
if Msg.Result=htClient then
Msg.Result:=htCaption;
end;
end.