如何控制窗体标题栏的高度 如何控制窗体标题栏的高度,清高手指教 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 处理 WM_NC..消息。在 WM_NCCALCSIZE 中改变标题栏高度。在 WM_NCPAINT 中 使用自己的字体绘制。 unit Unit1;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Label1: TLabel; private { Private declarations } procedure WMNCPAint(var Mes : TWMNCPaint); message WM_NCPAINT; procedure WMNCACTIVE(var msg: TMessage); message WM_NCACTIVATE;procedure Paint_Caption; public { Public declarations } end;var Form1: TForm1;implementation{$R *.DFM}var State:Integer;procedure TForm1.WMNCPAint(var Mes : TWMNCPaint);begin inherited; Paint_Caption;end;procedure TForm1.Paint_Caption;var ACanvas : TCanvas;begin ACanvas := TCanvas.Create; try ACanvas.Handle := GetWindowDC(Form1.Handle); with ACanvas do begin if State=1 then Brush.Color := clActiveCaption else Brush.Color := clInactiveCaption; Font.Name := 'Times New Roman'; Font.Size := 12; Font.Color := clYellow; Font.Style := [fsBold]; TextOut(GetSystemMetrics(SM_CYMENU) + GetSystemMetrics(SM_CXBORDER), Round((GetSystemMetrics(SM_CYCAPTION) - Abs(Font.Height))/2) +1, '抄袭千堆雪'); end; finally ReleaseDC(Form1.Handle, ACanvas.Handle); ACanvas.Free; end;end;procedure TForm1.WMNCACTIVE(var msg: TMessage);begin inherited; State:=msg.WParam; Paint_Caption;end;end. http://www.csdn.net/cnshare/soft/14/14929.shtm 谁能给出一个判断字符串编码(codepage,如简体936)的代码? 如何将信息始终写入文本的第一行? 问:这段sql应该如何写? 那位高手作过类似POTOSHOP 的图形处理软件,高份求教 回车可以用'key=#13'表示,那'Esc'可以用什么来表示啊?还有什么可以模拟'shift'键?在线等 ToolButton1问题,帮忙. 我发现delphi的database desktop中的一个怪异的问题!希望大家进来讨论,给出解决的法案!! 请个位大虾一定帮帮忙 Media player8 ~~~~谢谢了先!!再现等待 极简单问题 异常错误的问题! 怎样加上图标?
在 WM_NCCALCSIZE 中改变标题栏高度。
在 WM_NCPAINT 中 使用自己的字体绘制。
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;type
TForm1 = class(TForm)
Label1: TLabel;
private
{ Private declarations }
procedure WMNCPAint(var Mes : TWMNCPaint); message WM_NCPAINT;
procedure WMNCACTIVE(var msg: TMessage); message WM_NCACTIVATE;procedure Paint_Caption; public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}
var
State:Integer;procedure TForm1.WMNCPAint(var Mes : TWMNCPaint);
begin
inherited;
Paint_Caption;
end;procedure TForm1.Paint_Caption;
var
ACanvas : TCanvas;
begin ACanvas := TCanvas.Create;
try
ACanvas.Handle := GetWindowDC(Form1.Handle);
with ACanvas do begin
if State=1 then
Brush.Color := clActiveCaption
else
Brush.Color := clInactiveCaption; Font.Name := 'Times New Roman';
Font.Size := 12;
Font.Color := clYellow;
Font.Style := [fsBold]; TextOut(GetSystemMetrics(SM_CYMENU) + GetSystemMetrics(SM_CXBORDER),
Round((GetSystemMetrics(SM_CYCAPTION) - Abs(Font.Height))/2) +1,
'抄袭千堆雪');
end;
finally
ReleaseDC(Form1.Handle, ACanvas.Handle);
ACanvas.Free;
end;
end;procedure TForm1.WMNCACTIVE(var msg: TMessage);
begin
inherited;
State:=msg.WParam;
Paint_Caption;
end;end.