无边框窗体,用鼠标改变大小,在VC下如何实现,delphi下很简单就实现了? ( 积分: 100 )

  • 主题发起人 主题发起人 microchu
  • 开始时间 开始时间
M

microchu

Unregistered / Unconfirmed
GUEST, unregistred user!
给出Delhpi代码如下:
unit Unit1;

interface

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

type
TForm1 = class(TForm)
procedure WmNcHitTest(var msg:TWmNcHitTest);message wm_NcHitTest;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}
procedure TForm1.WmNcHitTest(var msg:TWmNcHitTest);

var

pt:tpoint;

begin

pt:=point(msg.xpos,msg.ypos);
pt:=ScreentoClient(pt);
if (pt.x>width-5) then
msg.Result:=htright
else
inherited;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
BorderStyle := bsNone;
end;

end.
求教高人,为什么在vc下ONHitTest函数下写类似功能的代码无效?
在VC下这样的功能又如何实现呢?
 
给出Delhpi代码如下:
unit Unit1;

interface

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

type
TForm1 = class(TForm)
procedure WmNcHitTest(var msg:TWmNcHitTest);message wm_NcHitTest;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}
procedure TForm1.WmNcHitTest(var msg:TWmNcHitTest);

var

pt:tpoint;

begin

pt:=point(msg.xpos,msg.ypos);
pt:=ScreentoClient(pt);
if (pt.x>width-5) then
msg.Result:=htright
else
inherited;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
BorderStyle := bsNone;
end;

end.
求教高人,为什么在vc下ONHitTest函数下写类似功能的代码无效?
在VC下这样的功能又如何实现呢?
 
顶一下,有人知道么?
 
后退
顶部