手机站
网通分站
电信主站
密 码:
用户名:
当前位置 : 主页>程序设计>delphi>列表

来点实用的,自己画带标题栏窗体,可当模态窗体样继承 bob008原创在CSDN 发表于2005-0

来源:互联网 作者:西部数码 时间:2008-04-10
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!

begin
Bitblt(cv.handle, (width - 90), 1, 26, 30, imgmin.canvas.handle, 52, 0, SRCcopy);
end
else
begin
Bitblt(cv.handle, (width - 90), 1, 26, 30, imgmin.canvas.handle, 0, 0, SRCcopy);
end;
if msg.HitTest = htmaxbutton then
begin
if windowstate = wsNormal then
begin
Bitblt(cv.handle, (width - 64), 1, 26, 30, imgMax.canvas.handle, 52, 0, SRCcopy);
end
else if windowstate = wsMaximized then
begin
Bitblt(cv.handle, (width - 64), 1, 26, 30, imgrestore.canvas.handle, 52, 0, SRCcopy);
end;
end
else if windowstate = wsNormal then
begin
Bitblt(cv.handle, (width - 64), 1, 26, 30, imgMax.canvas.handle, 0, 0, SRCcopy);
end
else if windowstate = wsMaximized then
begin
Bitblt(cv.handle, (width - 64), 1, 26, 30, imgrestore.canvas.handle, 0, 0, SRCcopy);
end;
if msg.HitTest = htclose then
begin
Bitblt(cv.handle, (width - 38), 1, 26, 30, imgclose.canvas.handle, 52, 0, SRCcopy);
end
else
begin
Bitblt(cv.handle, (width - 38), 1, 26, 30, imgclose.canvas.handle, 0, 0, SRCcopy);
end;
end;
end;
finally
releasedc(handle, cv.handle);
cv.free;
end;
end;
//------------------------------------------------------------------------------
//我们要做什么?
//那几个BUTTON让偶们要干掉它们,省得它们坏事
//当然把它们屏蔽后应该干啥,干自己的事情撒
//------------------------------------------------------------------------------
procedure TForm1.FormCreate(Sender: TObject);
var
hsizens : HICON; //好界面配上好光标才帅吗!用了WINDOWS变脸软件里的光标
hsizewe : HICON;
hsizeall : HICON;
hsizeall1 : HICON;
hsizenesw : Hicon;
hsizenwse : Hicon;
hwait : HICON;
happstart : HICON;
harrow : HICON;
hhandwriting : Hicon;
hhelp : HICON;
hno : HICON;
hcross : Hicon;
hibeam : Hicon;
hhand : Hicon;
hup : Hicon;
begin
hsizens:=loadcursorfromfile(''''cursors\sizens.ani'''');
hsizewe:=loadcursorfromfile(''''cursors\sizewe.ani'''');
hsizeall:=loadcursorfromfile(''''cursors\sizeall.cur'''');
hsizeall1:=loadcursorfromfile(''''cursors\sizeall1.cur'''');
hsizenesw:=loadcursorfromfile(''''cursors\sizenesw.ani'''');
hsizenwse:=loadcursorfromfile(''''cursors\sizenwse.ani'''');
hwait:=loadcursorfromfile(''''cursors\wait.ani'''');
happstart:=loadcursorfromfile(''''cursors\appstarting.ani'''');
harrow:=loadcursorfromfile(''''cursors\arrow.cur'''');
hhandwriting:=loadcursorfromfile(''''cursors\handwriting.ani'''');
hhelp:=loadcursorfromfile(''''cursors\help.ani'''');
hno:=loadcursorfromfile(''''cursors\no.ani'''');
hcross:=loadcursorfromfile(''''cursors\cross.ani'''');
hibeam:=loadcursorfromfile(''''cursors\ibeam.ani'''');
hhand:=loadcursorfromfile(''''cursors\hand.ani'''');
hup:=loadcursorfromfile(''''cursors\uparrow.ani'''');
setsystemcursor(harrow,ocr_normal);
setsystemcursor(hsizens,ocr_sizens);
setsystemcursor(hsizewe,ocr_sizewe);
setsystemcursor(hsizeall,ocr_sizeall);
setsystemcursor(hsizeall1,ocr_size);
setsystemcursor(hsizenesw,ocr_sizenesw);
setsystemcursor(hsizenwse,ocr_sizenwse);
setsystemcursor(hwait,ocr_wait);
setsystemcursor(happstart,ocr_appstarting);
setsystemcursor(hhandwriting,OIC_note);
setsystemcursor(hhelp, OCR_ICOCUR );
setsystemcursor(hno,ocr_no);
setsystemcursor(hcross,ocr_cross);
setsystemcursor(hibeam,ocr_ibeam);
setsystemcursor(hhand,OCR_HAND);
setsystemcursor(hup,ocr_up);
iStyle := setwindowlong(handle, gwl_style, getwindowlong(handle, gwl_style) and not ws_minimizebox and
not ws_maximizebox and not ws_sysmenu);//设置窗口样式有SYSMENU一样会有CLOSEBUTTON的,所

//以把SYSMENU也去掉,这样没有默认的按钮绘制会影响我们了
application.Minimize; //MS不知道是怎么搞的,窗体载入时的状态切换消息几乎没时间差异,哇,多压入一个
application.Restore; //设备场景的内存用量,大家NEW一个PROJECT看光1个窗体载入时3.2MB左右

//最小化后1.6MB左右,如果用户根本一直让你的软件工作在正常状态下(没有最小化)那么那多余的1.6MB

//左右的内存也就不会被释放,所以,我们似乎应该做些工作先

end;

procedure TForm1.FormPaint(Sender: TObject);
begin
DrawActivate;//画偶们的
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
SystemParametersinfo(SPI_SETCURSORS,0,nil,SPIF_SENDCHANGE);//恢复系统光标
//呵呵,偶好自私,不让你们用偶的程序的鼠标样式
end;

end.

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!