[Delphi版]罗技无限灵貂,驱动程序补丁-实现真正的多媒体播放器!附QQ图标伪装程序[2]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

   
implementation
    procedure EnableWheelHook ; stdcall; external 'HookPrj.dll';
    procedure DisableWheelHook; stdcall; external 'HookPrj.dll';
{$R *.dfm}

procedure Tf.FormCreate(Sender: TObject);//█████████████ 界面初始化
begin
    FormStyle := fsStayOnTop;
    Height:=0;
    Width:=0;
    Hide;
   
    Tmr.Interval := 50;
   
    ShowWindow(Application.Handle, SW_HIDE);
    SetWindowLong(Application.Handle, GWL_EXSTYLE,
        GetWindowLong(Application.handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW AND NOT WS_EX_APPWINDOW);

    EnableWheelHook;//罗技灵貂蓝色侧键,WM_MouseWheel 消息钩子
end;

procedure Tf.GetMousePosHwndAndClassName(Sender: TPoint);//███ 伪装标题栏
var hWnd: THandle;
    aTitle: array [0..255] of char;
    str:string;
begin
    hWnd := WindowFromPoint(Sender);

    if boolean(GetWindowText(hWnd, aTitle, 256)) then begin
        str :=  string(aTitle);

        //QQ
        if ((pos('与',str)>0) and (pos('聊天中',str)>0)) then begin
            str:=replacing(str, ' 聊天中', '');
            str:=replacing(str, '与', '我的文档');
            SetWindowText(hWnd,pchar(str));
        end;

        if ((pos('群 -',str)>0) or (pos('高级群 -',str)>0)) then begin
            str:=replacing(str, '群 -', '我的信件');
            str:=replacing(str, '高级', '');
            SetWindowText(hWnd,pchar(str));
        end;

        //聊天室
        if pos('QQ 聊天室', str)>0 then begin
            str := 'Microsoft Visual C++ 6.2';
            SetWindowText(hWnd,pchar(str));
        end;

        //MSN
        if pos(' - 对话', str)>0 then begin
            str := replacing(str, ' - 对话', '工作文档');
            SetWindowText(hWnd,pchar(str));
        end;
    end;
end;

procedure Tf.TmrTimer(Sender: TObject);//████████████▌定时器
var rPos: TPoint;
begin
    if boolean(GetCursorPos(rPos)) then GetMousePosHwndAndClassName(rPos);
end;

function Tf.replacing(s,source,target:string):string;//█████ 替换字符串
var site, strlen: integer;
begin
    site:=pos(source,s);
    strlen:=length(source);
    delete(s,site,strlen);
    insert(target,s,site);
    result:=s;
end;

procedure Tf.WndProc(var Message: TMessage);////███████▌罗技无限灵貂
begin with Message do begin
    inherited;

    //如果不是多媒体键区的中右侧三个键按下,则退出
    IF NOT(  (Msg=LOGITECH) and ((lParam=PLAY_PAUSE)or(lParam=PLAY_LEFT)or(lParam=PLAY_RIGHT))  ) THEN exit;

    hFocus := GetForegroundWindow;
    GetWindowText(hFocus, buf, 1024);
    sTitle := string(buf);
    deb(sTitle);

    //ACDSee
    if (pos('ACDSee', sTitle)>0) and (pos('5.0', sTitle)>0) and (Msg=LOGITECH) then case lParam of
        PLAY_PAUSE: Key2(VK_Control, VK_Delete);//Ctrl+Del
        PLAY_LEFT : Key2(VK_Menu   , ord('M') );//Alt+M
        PLAY_RIGHT: Key2(VK_Menu   , Ord('C') );//Alt+C
    end;

本文关键:[Delphi版]罗技无限灵貂,驱动程序补丁-实现真正的多媒体播放器!附QQ图标伪装程序
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top