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
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




