VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)

VB爱好者乐园(VBGood)

 找回密码
 立即注册
搜索
查看: 4646|回复: 8

[经验技巧] QQ快速上下线.代码实现

[复制链接]
头像被屏蔽
 楼主| 发表于 2010-6-10 19:43:23 | 显示全部楼层 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2010-6-10 20:38:01 | 显示全部楼层
汗 我还以为 源码呢~ 放个这 没敢打开的啊
回复 支持 反对

使用道具 举报

发表于 2010-6-10 23:32:28 | 显示全部楼层
没代码 忽悠
回复 支持 反对

使用道具 举报

头像被屏蔽
 楼主| 发表于 2010-6-10 23:33:09 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

发表于 2010-6-11 09:50:14 | 显示全部楼层
好熟悉的344C,3429消息..

好像曾经在论坛哪里看过..
回复 支持 反对

使用道具 举报

发表于 2010-6-11 16:09:32 | 显示全部楼层
08的P用哦???
我要10的!
回复 支持 反对

使用道具 举报

发表于 2010-6-12 22:38:20 | 显示全部楼层
QQ2008  你....

来个2010的? 源码!
回复 支持 反对

使用道具 举报

发表于 2010-6-20 09:50:11 | 显示全部楼层
   
Entry Point    u application PE GUI;
include "Windows.inc";  
//entry main
//include "form.inc";

entry

    WinMain();

end.?
FormMoudle   ?
import srand lib "msvcrt.dll", 1;
import rand lib "msvcrt.dll", 0;
import StrToInt alias StrToIntA lib "shlwapi.dll", 1;
import lstrlen alias lstrlenA lib "kernel32.dll",1;

const AW_HOR_POSITIVE = $1;
const AW_HOR_NEGATIVE = $2;
const AW_VER_POSITIVE = $4;
const AW_VER_NEGATIVE = $8;
const AW_CENTER = $10;
const AW_HIDE = $10000;
const AW_ACTIVATE = $20000;
const AW_SLIDE = $40000;
const AW_BLEND = $80000;
const RAND_MAX = $7FFF;
const IDI_APPICON = 101;

MSG msg;
WNDCLASS wc;
RECT rect;

string strTitle[15];
string strTitleDemo[29];
string strName[14];
string strTime[5];

dword hWindow;
dword hDemoWindow;
dword hEditTime;
dword hBrushPrevious;
dword hBtnShow;
dword hBtnHide;
dword dwFlags;
dword dwTime;
dword dwColor;
dword FormLeft;
dword FormTop;
dword FormWidth;
dword FormHeight;
dword FormStyle;



frame StrToNum(dword ptrString);
    return(StrToInt(ptrString));
end;

frame SetChildFonts(dword hControl, dword lParam);
    SendMessage(hControl, WM_SETFONT, lParam, FALSE);
    return(TRUE);
end;

frame CenterOnDesktop(dword hWindow);
    local dword xPos; local dword yPos;
    GetWindowRect(hWindow, @rect);
//    Change this when order of operations is released.
    xPos = (GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) / 2;
    yPos = (GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) / 2;

    SetWindowPos(hWindow, HWND_TOP, xPos, yPos, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE);
end;


frame main();  

    strName = "a2si Window";

    wc.style = CS_HREDRAW | CS_VREDRAW;
    wc.lpfnWndProc = @WndProc;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.hInstance = 0;
    wc.hIcon = LoadIcon(0, IDI_APPICON);
    wc.hCursor = LoadCursor(0, IDC_ARROW);
    wc.hbrBackground = 15 + 1;
    wc.lpszMenuName = "";
    wc.lpszClassName = @strName;

    if (RegisterClass(@wc) = 0) {
        MessageBox(0, "RegisterClass failed.", @strName, MB_OK);
        ExitProcess(0);
    }

    hWindow = CreateWindowEx(0, @strName, @strTitle, FormStyle, FormLeft, FormTop, FormWidth, FormHeight, 0, 0, 0, 0);

    if (hWindow = 0) {
        MessageBox(0, "CreateWindowEx failed.", @strName, MB_OK);
        UnregisterClass(@strName, 0);
        ExitProcess(0);
    }

    ShowWindow(hWindow, SW_SHOWNORMAL);
    UpdateWindow(hWindow);

// WS_OVERLAPPEDWINDOW doesn't work.

    InitCommonControls();
    srand(GetTickCount());
    CreateControls();
    EnumChildWindows(hWindow, @SetChildFonts, GetStockObject(ANSI_VAR_FONT));
    CenterOnDesktop(hWindow);

    while (GetMessage(@msg, 0, 0, 0) > 0) {
        TranslateMessage(@msg);
        DispatchMessage(@msg);
    }

    UnregisterClass(@strName, 0);
end;
? ModRun   C

import StrToInt alias StrToIntA lib "shlwapi.dll",1;

import CreateThread lib "kernel32.dll",6;
import ExitThread lib "kernel32.dll",1;
import TerminateThread lib "kernel32.dll",2;

import Sleep lib "kernel32.dll",1;

import EnumWindows lib "user32.dll",2;
import SendMessage alias SendMessageA lib "user32.dll",4;
import GetWindowLong alias GetWindowLongA lib "user32.dll",2;
import ExitThread lib "kernel32.dll",0;
import SetWindowText alias SetWindowTextA lib "user32.dll",2;


dword TexthWnd;
boolean WorkThis;
dword ThreadId;
dword QQhWnd;
dword Sp;
string sBuffer[5];

frame EnumQQWindow(dword hWnd,dword lParam) as dword;
dword WinStyle;

    WinStyle = GetWindowLong(hWnd, GWL_STYLE);
    if (WinStyle = $96040044) {
        QQhWnd = hWnd;
//        Format(sBuffer,"QQ hWnd: %d",hWnd);
//        MessageBox(0,sBuffer,strTitle,64);
    }
    return(1);
end;

frame QQStateChange() as dword;

while (1=1) {
       SendMessage(QQhWnd, $111, $344C, 0);
       SendMessage(QQhWnd, $111, $3429, 0);
        if (WorkThis = FALSE) {
            ExitThread(0);
            //return(1);
        }
           
        Sleep(Sp);
}

        return(1);
end;


frame InitQQ();
    EnumWindows(@EnumQQWindow, 0);
end;



frame WinMain();

    WorkThis=FALSE;

    FormLeft=100;
    FormTop=100;
    FormWidth=150;
    FormHeight=110;
   
    FormStyle=WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU;
//FormStyle=WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;

        strTitle = "QQ2008快闪";

    InitQQ();

    main();

end;

frame CreateControls();
    CreateWindowEx(0, "Static", "延时: ", SS_SIMPLE | WS_CHILD | WS_VISIBLE, 10, 10, 80, 20, hWindow, 121, 0, 0);
    TexthWnd = CreateWindowEx(WS_EX_CLIENTEDGE ,"Edit", "0", ES_LEFT | ES_NUMBER | WS_CHILD | WS_VISIBLE, 60, 10, 50, 20, hWindow, 122, 0, 0);
    hBtnShow = CreateWindowEx(0, "Button", "开始", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE, 10, 40, 100, 30, hWindow, 131, 0, 0);
end;

frame WndProc(dword hwnd, dword message, dword wparam, dword lparam);
dword ret;
    if (message = WM_COMMAND) {
    if (lparam = hBtnShow)  {
        ret=OnCommand();
        return(ret);
    }
    return(1);
    }
    if (message = WM_DESTROY) {
        ExitProcess(0);
    }
    return(DefWindowProc(hwnd, message, wparam, lparam));
end;

frame OnCommand() as dword;

    if (QQhWnd = 0) {
        MessageBox(0,"没有找到 QQ !",strTitle,64);
        return(1);
    }
    if (WorkThis = FALSE) {
        SetWindowText(hBtnShow,"停止");
        GetWindowText(TexthWnd, @sBuffer, 5);
        Sp=Str2Int(sBuffer);
        ThreadId=CreateThread(0,0,@QQStateChange ,0,0,0);
    }

    if (WorkThis = TRUE) {
        SetWindowText(hBtnShow,"开始");
        //TerminateThread(ThreadId,0);
    }
    WorkThis=!WorkThis;
    return(1);
end;


frame Str2Int(dword ptrString) as dword;
        return(StrToInt(ptrString));
end;?


是C#?
回复 支持 反对

使用道具 举报

发表于 2010-6-20 15:13:30 | 显示全部楼层
8# wajika

不,VisiaCompiler……用VB编的一个编译器,语法相当山寨……
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

文字版|手机版|小黑屋|VBGood  

GMT+8, 2022-7-4 04:40

VB爱好者乐园(VBGood)
快速回复 返回顶部 返回列表