复制内容到剪贴板
代码:
#COMPILE DLL "E:\天下魔力\txml.dll"
#DIM ALL
GLOBAL ghInstance AS DWORD
GLOBAL tz AS DWORD
GLOBAL TzJmp AS DWORD
GLOBAL windows AS DWORD
复制内容到剪贴板
代码:
#INCLUDE ONCE ".\Module\WIN32API.INC"
#INCLUDE ONCE ".\Module\Hook.Inc"
'------------------------------------------------------------------------------
$OLDWNDPROC = "OldWndProc"
GLOBAL HookPaint AS LONG
'子类化开始
FUNCTION SubClass(hWnd AS LONG) AS LONG
DIM lpfnOld AS LONG
DIM fSuccess AS LONG
IF (GetProp(hWnd, $OLDWNDPROC) = 0) THEN
lpfnOld = SetWindowLong(hWnd, %GWL_WNDPROC, CODEPTR(WndProc))
IF lpfnOld THEN
fSuccess = SetProp(hWnd, $OLDWNDPROC, lpfnOld)
END IF
END IF
IF fSuccess THEN
SubClass = 1
ELSE
IF lpfnOld THEN CALL UnSubClass(hWnd)
END IF
END FUNCTION
'卸载子类化
FUNCTION UnSubClass(hWnd AS LONG) AS LONG
DIM lpfnOld AS LONG
lpfnOld = GetProp(hWnd, $OLDWNDPROC)
IF lpfnOld THEN
IF RemoveProp(hWnd, $OLDWNDPROC) THEN
UnSubClass = SetWindowLong(hWnd, %GWL_WNDPROC, lpfnOld)
END IF
END IF
END FUNCTION
FUNCTION WndProc(BYVAL hWnd AS LONG, BYVAL uMsg AS LONG, BYVAL wParam AS LONG, BYVAL lParam AS LONG) AS LONG
SELECT CASE uMsg
CASE %WM_ACTIVATE,%WM_ACTIVATEAPP,%WM_SETFOCUS
Tz = 0
CASE %WM_KILLFOCUS
Tz = 1
CASE %WM_NCDESTROY ' 如果收到组件被销毁的消息,恢复源窗口过程处理函数
CALL UnSubClass(hWnd)
END SELECT
WndProc = CallWindowProc(GetProp(hWnd, $OLDWNDPROC), hWnd, uMsg, wParam, lParam)
END FUNCTION
复制内容到剪贴板
代码:
FUNCTION LIBMAIN (BYVAL hInstance AS LONG, _
BYVAL fwdReason AS LONG, _
BYVAL lpvReserved AS LONG) AS LONG'EXPORT AS LONG
SELECT CASE fwdReason
CASE %DLL_PROCESS_ATTACH
windows = PEEK(DWORD,&H008E53FC)
'跳帧
IF INSTR(COMMAND$, "onlyactive" ) > 0 THEN
subclass(windows)
CALL Hook(&H433180, CODEPTR(GameTzHook), 0)
END IF
ghInstance = hInstance
VirtualProtect(BYVAL &H401000, &H114000, %PAGE_READWRITE,0)
FUNCTION = 1 'success!
CASE %DLL_PROCESS_DETACH
FUNCTION = 1 'success!
CASE %DLL_THREAD_ATTACH
FUNCTION = 1 'success!
CASE %DLL_THREAD_DETACH
FUNCTION = 1 'success!
END SELECT
END FUNCTION
复制内容到剪贴板
代码:
FUNCTION GameTzHook()AS LONG '
!cmp Tz,0
!Ja EndTz
TzJmp = &H00433185
!MOV EAX,DWORD PTR DS:[&H008E5410]
!JMP TzJmp
EndTz:
!Retn
END FUNCTION
这是我当年的天下魔力给cg_190添加的跳帧效果的PB代码。