您现在的位置:首页 >> VCL >> VCL >> 内容

Delphi之非QQ会员突破会员限制进行QQ表情编辑

时间:2011/9/3 16:26:43 点击:

  核心提示:最新版的QQ出来了一个新的特性,就是可以编辑QQ表情,向其中添加一些自己要说的话语。 但是这个特性好象需要开通会员吧!想想腾讯的策划部到是会抓商机呢。下面我将说说怎样使用非会员来使用QQ表情的编辑工具...
最新版的QQ出来了一个新的特性,就是可以编辑QQ表情,向其中添加一些自己要说的话语。

但是这个特性好象需要开通会员吧!想想腾讯的策划部到是会抓商机呢。下面我将说说怎样使用非会员来使用QQ表情的编辑工具呢。

  我们打开QQ表情编辑的那个对话框,可以看出,他根本不会触发任何的网络的消息出去! 只是在最开始打开的时候会判断一下当前

用户是否为会员,如果不是的话,那么很多项目则不可用,我们可以很轻易的想到一个API函数EnableWindow函数可以解除那些Enable

为false的控件(只要知道他的消息句柄则可)。现在我们先假定一下,QQ表情编辑在编辑好了之后,用户点完成不会向腾讯服务器发送

询问的(想想他应该不会抠门到这个程度吧!搞个编辑也要发个会员验证),先用Spy++一下,可以轻易的找到那些Enable为false的消息句柄,那 么现在就好办了,直接使用enableWindow(Handle),看一下则解除禁止了。很简单。然后测试一下效果,果然可以。呵呵。那么我们只用写个 代码来找句柄,然后在Enable他,则完了。

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, RzCommon,RzLabel, RzButton, ExtCtrls, RzPanel;

Const
  WM_DESTROYPN = WM_USER + 100;

type
  TRzPanel = Class(RzPanel.TRzPanel)
  protected
    Procedure WndProc(Var Msg: TMessage);override;
  public
    Constructor Create(AOwner: TComponent);override;
  end;
  TForm1 = class(TForm)
    RzLabel1: TRzLabel;
    btn1: TRzButton;
    procedure btn1Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
    BegPos: TPoint;
    EdtHandle: THandle;
    Pn: TRzPanel;
    procedure DestroyPn(Var Msg: TMessage);message WM_DESTROYPN;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation
var
  HsFree: Boolean=false;
  HsJieChu: boolean=false;
{$R *.dfm}

procedure SetControlOwner(Component: TComponent;NewOwner: TComponent);
var
  tempOwner: ^integer;
begin
   tempOwner := @(integer(Component.Owner));
   tempOwner^ := integer(NewOwner);
end;

procedure EnabledQQEdit;
  procedure BlHandle(ParentHandle: THandle);
  var
    backHwnd,tempHwnd:hWnd;
  begin
    backHwnd:=Getwindow(ParentHandle,GW_CHILD);
    while backHwnd<>0 do
    begin
      EnableWindow(backHwnd,true);
      tempHwnd := backHwnd;
      BlHandle(tempHwnd);
      backhwnd:=Getwindow(backhwnd,GW_HWNDNEXT);
    end;
  end;
var
  FrmHandle: THandle;
begin
  FrmHandle := FindWindow('#32770','编辑涂鸦表情');
  if FrmHandle <> 0 then
  begin
    SendMessage(FrmHandle,wm_settext,0,integer(Pchar('不得闲QQ表情编辑解禁!
作者:不得闲!QQ: 75492895')));
    Application.MessageBox('QQ表情编辑工具解除禁止成功!','消息',64);
    SetForegroundWindow(FrmHandle);
    BlHandle(FrmHandle);
  end
  else
    Application.MessageBox('您没有打开QQ表情编辑工具!','消息',64);
end;

procedure EnabledQQEdit1;
var
  FrmHandle,ModHandle: THandle;
  rec: TRect;
  Pn: TRzPanel;
  OldWidth: integer;
  procedure BlHandle(ParentHandle: THandle);
  var
    backHwnd,tempHwnd:hWnd;
  begin
    backHwnd:=Getwindow(ParentHandle,GW_CHILD);
    while backHwnd<>0 do
    begin
      EnableWindow(backHwnd,true);
      tempHwnd := backHwnd;
      BlHandle(tempHwnd);
      backhwnd:=Getwindow(backhwnd,GW_HWNDNEXT);
    end;
  end;
begin
  FrmHandle := FindWindow('#32770','编辑涂鸦表情');
  if (FrmHandle <> 0) and (not HsJieChu) then
  begin
    SendMessage(FrmHandle,wm_settext,0,integer(Pchar('不得闲QQ表情编辑解禁!
作者:不得闲!QQ: 75492895')));
    Form1.EdtHandle := FrmHandle;
    GetWindowRect(FrmHandle,Rec);
    Form1.BegPos.X := Rec.Right - Rec.Left;
    Form1.BegPos.Y := Rec.Bottom - Rec.Top;
    OldWidth := Rec.Right - Rec.Left + 2;
    SetWindowPos(FrmHandle,0,0,0,48 + OldWidth,rec.Bottom - rec.Top,6);
    Pn := TRzPanel.Create(nil);
    HsFree := false;
    Pn.Parent := Form1;
    Form1.Pn := Pn;
    Pn.Top :=  25;
    SetParent(Pn.Handle,FrmHandle);
    SetControlOwner(Pn,Pn.Parent);
    FrmHandle := FindWindowEx(FrmHandle,0,'#32770','');
    if FrmHandle <> 0 then
    begin
      GetWindowRect(FrmHandle,Rec);
      Pn.Left := OldWidth - 10;
      Pn.Height := rec.Bottom - rec.Top - 34;
      Pn.Width := 55;
      SetWindowPos(FrmHandle,0,0,0,OldWidth-2,rec.Bottom - rec.Top,6);

      ModHandle := FindWindowEx(FrmHandle,0,'Edit','');
      if ModHandle <> 0 then
        EnableWindow(ModHandle,true);

      ModHandle := FindWindowEx(FrmHandle,0,'Static','');
      if ModHandle <> 0 then
        EnableWindow(ModHandle,True);
      ModHandle := FindWindowEx(FrmHandle,0,'Button','完成');
      if ModHandle <> 0 then
        EnableWindow(ModHandle,true);
      ModHandle := FindWindowEx(FrmHandle,0,'Static','您还不是会员,
开通QQ会员即可使用');
      if ModHandle <> 0 then
        SetWindowText(ModHandle,'不得闲QQ表情编辑解禁工具1.0');
      Application.MessageBox('QQ表情编辑工具解除禁止成功!','消息',64);
      SetForegroundWindow(FrmHandle);
      HsJieChu := true;
    end;
  end;
end;


procedure TForm1.btn1Click(Sender: TObject);
begin
  EnabledQQEdit1
end;

procedure TForm1.DestroyPn(var Msg: TMessage);
begin
  pn := TRzPanel(Msg.WParam);
  if not HsFree then
  begin
    HsFree := true;
    HsJieChu := false;
    FreeAndNil(pn);
  end;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  if not HsFree then
  begin
    HsFree := true;
    Pn.Free;
    SetWindowPos(EdtHandle,0,0,0,BegPos.X,BegPos.Y,6);
  end;
end;

{ TRzPanel }

constructor TRzPanel.Create(AOwner: TComponent);
var
  Rz1,Rz2: TRzLabel;
begin
  inherited Create(AOwner);
  HsFree := false;
  Rz1 := TRzLabel.Create(self);
  Rz1.Parent := self;
  Rz1.Caption :='欢'#13#10'迎'#13#10'使'#13#10'用'#13#10'QQ'#13#10'表'
#13#10'情'#13#10'编 '#13#10'辑'#13#10'禁'#13#10'止'#13#10'解'#13#10'除'
#13#10'工'#13#10'具 '#13#10'V1';
  Rz1.Align := AlTOp;
  Rz1.AutoSize := false;
  Rz1.Alignment := taCenter;
  Rz1.TextStyle := tsRaised;
  Rz1.Height := 196;
  Rz1.Font.Name := '宋体';
  Rz1.Font.Charset := GB2312_CHARSET;
  Rz1.Font.Size := 9;
  Rz1.Transparent := true;
  Rz1.Font.Color := clMaroon;
  Rz1.Font.Style := [fsbold];

  Width := 57;
  Rz2 := TRzLabel.Create(self);
  Rz2.Parent := self;
  Rz2.Align := AlBottom;
  Rz2.AutoSize := false;
  Rz2.Caption := '作者:'#13#10' 不得闲'#13#10'QQ:'#13#10'75492895';
  Rz2.Height := 57;
  Rz2.Font.Assign(Rz1.Font);
  Rz2.TextStyle := tsRaised;
  Rz2.Transparent := true;
  VisualStyle := vsGradient;
  GradientColorStyle := gcsCustom;
  GradientColorStart := $00FFAA55;
  GradientColorStop := $00FFAA55;
  BorderOuter := fsNone;
end;

procedure TRzPanel.WndProc(var Msg: TMessage);
begin
  if Msg.Msg = WM_DESTROY then
    SendMessage(Form1.Handle,WM_DESTROYPN,integer(self),0);
  Inherited
end;

end.

作者:不得闲 来源:转载
共有评论 0相关评论
发表我的评论
  • 大名:
  • 内容:
本类推荐
  • 没有
本类固顶
  • 没有
  • 盒子文章(www.2ccc.com) © 2024 版权所有 All Rights Reserved.
  • 沪ICP备05001939号