⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 phizunt.pas

📁 絮语2007视频聊天软件源程序.仅供参考
💻 PAS
字号:
unit phizunt;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Buttons, ExtCtrls,StdCtrls,ComCtrls,gifimage,constunt;

type
  Tphizfrm = class(TForm)
    Panel1: TPanel;
    procedure buttonClick(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure focusenot(var Msg: TMessage); message WM_KILLFOCUS;
    procedure notfocuse(var Msg: TMessage); message WM_ACTIVATE;
  private
    tmpbutton:tspeedbutton;
    procedure createspbutton;
    { Private declarations }
  public
    msghandle:hwnd;
    sel_md5str:string;
    { Public declarations }
  end;

var phizfrm: Tphizfrm;

implementation

uses shareunit, udpcores;

{$R *.DFM}

procedure Tphizfrm.createspbutton;
var i,m,n,k:integer;
    s,picfile,tmpstr:string;
    tmpic:TPicture;
begin
k:=1;
if facelist.Count>0 then
for i:=1 to facelist.Count do
  begin
  s:=facelist.Strings[i-1];
  tmpstr:=copy(s,1,34);
  delete(s,1,34);
  picfile:=udpcore.pic.getmd5tofile(tmpstr);
  if fileexists(picfile) then
    try
    tmpic:=TPicture.create;
      try
      tmpic.LoadFromFile(picfile);
      tmpbutton:=tspeedbutton.Create(self);
      tmpbutton.Parent:=panel1;
      tmpbutton.Margin:=1;
      tmpbutton.Caption:=tmpstr;
      tmpbutton.Hint:=s;
      tmpbutton.showhint:=true;
      tmpbutton.Width:=24;
      tmpbutton.height:=24;
      tmpbutton.Flat:=true;
      tmpbutton.Transparent:=true;
      tmpbutton.OnClick:=buttonClick;
      tmpbutton.Glyph.Assign(tmpic.Graphic);
      if k>16 then
        begin
        m:=k div 16;     // top...    0
        n:=k mod 16;     // left..    1
        if n=0 then
          begin
          n:=16;
          m:=m-1;
          end;
        m:=(m)*25;
        n:=(n-1)*25;
        end else begin
        m:=0;
        n:=(k-1)*25;
        end;
      tmpbutton.Top:=m;
      tmpbutton.Left:=n;
      inc(k);
      except
        on EInvalidGraphic do
           tmpic:= nil;
      end;
    finally;
    freeandnil(tmpic);
    end;
  end;
end;

procedure Tphizfrm.buttonClick(Sender: TObject);
begin
sel_md5str:=tspeedbutton(sender).caption;
postmessage(msghandle,refresh_status,xy_phiz,0);
close;
end;

procedure Tphizfrm.focusenot(var Msg: TMessage);
begin
inherited ;
close;
end;

procedure Tphizfrm.notfocuse(var Msg: TMessage);
begin
inherited ;
if msg.WParam=WA_INACTIVE then close;
end;

procedure Tphizfrm.FormShow(Sender: TObject);
begin
if not autosize then autosize:=true;
if not panel1.AutoSize then panel1.AutoSize:=true;
end;

procedure Tphizfrm.FormCreate(Sender: TObject);
begin
udpcore.changeLayered(handle);
createspbutton;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -