易截截图软件、单文件、免安装、纯绿色、仅160KB

Delphi实现透明窗体

unit unitMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure WMGetMinMaxInfo(var msg: TWMGetMinMaxInfo); message WM_GETMINMAXINFO;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
FullRgn, ClientRgn, ButtonRgn: THandle;
Margin, X, Y: Integer;
begin
Margin := (Width - ClientWidth) div 2;
FullRgn := CreateRectRgn(0, 0, Width, Height);
X := Margin;
Y := Height - ClientHeight - Margin;
ClientRgn := CreateRectRgn(X, Y, X + ClientWidth, Y + ClientHeight);
CombineRgn(FullRgn, FullRgn, ClientRgn, RGN_DIFF);
X := X + Button1.Left;
Y := Y + Button1.Top;
ButtonRgn := CreateRectRgn(X, Y, X + Button1.Width, Y + Button1.Height);
CombineRgn(FullRgn, FullRgn, ButtonRgn, RGN_OR);
SetWindowRgn(Handle, FullRgn, True);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
lf : TLogFont;
tf : TFont;
begin
with Form1.Canvas do
begin
Font.Name := 'Arial';
Font.Size := 24;
tf := TFont.Create;
try
tf.Assign(Font) ;
GetObject(tf.Handle, sizeof(lf), @lf) ;
lf.lfEscapement := 450;
lf.lfOrientation := 450;
tf.Handle := CreateFontIndirect(lf) ;
Font.Assign(tf) ;
finally
tf.Free;
end;
TextOut(20, Height div 2, 'Rotated Text!') ;
end;
end;
procedure TForm1.WMGetMinMaxInfo(var msg: TWMGetMinMaxInfo);
begin
inherited;
with msg.MinMaxInfo^.ptMaxTrackSize do
begin
X := GetDeviceCaps(Canvas.Handle, HORZRES)


相关文档:

简单的Delphi三层程序开发

 一年前开发了一个MIDAS的程序,最近修改服务端,可是这个服务无法注册,最后终于找到了解决办法,这个相关文章如下:(算是备份吧)
(一)MIDAS是什么?
Delphi中MIDAS到底是什么呢?和他相关组件是什么呢? 
MIDAS(Multitiered Distributed Application Services)多层分布式应用服务。
   Delphi所提出 ......

终于搞定了Delphi的Unicode支持(Tnt控件)

原来是要在FormCreate中加入以下代码:
procedure TTntForm1.TntFormCreate(Sender: TObject);
begin
  //这句很关键.对于平台的支持.
  if Win32Platform = VER_PLATFORM_WIN32_NT then
    Font.Name := 'MS Shell Dlg 2'
  else
    Font.Name := 'MS Shell Dlg';
......

Delphi编译指令说明

《Delphi下深入Windows核心编程》(附录A Delphi编译指令说明)
摘抄人:麻子 qq:71892967
Delphi快速高小的编译器主要来自Object PASCAL的严谨,使用Delphi随时都在与编译器交流,大部分情况下不需要干涉编译器的运行,但是有时也需要对编译器进行必要的设置。
*************************************************** ......

Delphi Excel to Sql Server

 unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls, Grids, DBGrids, DB, ADODB,comobj, OleServer,
  ExcelXP;
type
  TForm1 = class(TForm)
    ADOConn: TADOConnection;
& ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号