#RequireAdmin ; ko thong bao khi thieu var co them quyen admin ghi vao bo x32 #include #include #include #include #include #include ; "Chrome Remote Desktop - Remote Access - Chrome Remote Desktop" ; --- CHỐNG MỞ NHIỀU FILE CÙNG LÚC --- _Singleton("MOUSE_NEW01", 0) ; ------------------------------------ ; Ẩn icon dưới góc màn hình System Tray TraySetState(2) ; --- CHỈNH ĐỘ TO TẠI ĐÂY --- Global $Scale = 0.6 ; Bác cứ tùy chỉnh lại 0.6 hay 2.0 cho vừa mắt nhé ; --------------------------- Global $iW = Int(32 * $Scale), $iH = Int(32 * $Scale) Global $hGUI = GUICreate("FixCursor", $iW, $iH, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TRANSPARENT, $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW, $WS_EX_NOACTIVATE)) _GDIPlus_Startup() Global $hDC = _WinAPI_GetDC($hGUI) Global $hMemDC = _WinAPI_CreateCompatibleDC($hDC) Global $hBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $iW, $iH) _WinAPI_SelectObject($hMemDC, $hBitmap) Global $hGraphics = _GDIPlus_GraphicsCreateFromHDC($hMemDC) _GDIPlus_GraphicsSetSmoothingMode($hGraphics, 2) ; Bật chống răng cưa ; Tọa độ 7 điểm chuẩn của con trỏ Windows Local $aPoints[8][2] = [[7, 0]] $aPoints[1][0] = 0 $aPoints[1][1] = 0 $aPoints[2][0] = 0 $aPoints[2][1] = 23 * $Scale $aPoints[3][0] = 6 * $Scale $aPoints[3][1] = 17 * $Scale $aPoints[4][0] = 10 * $Scale $aPoints[4][1] = 26 * $Scale $aPoints[5][0] = 14 * $Scale $aPoints[5][1] = 24 * $Scale $aPoints[6][0] = 10 * $Scale $aPoints[6][1] = 15 * $Scale $aPoints[7][0] = 17 * $Scale $aPoints[7][1] = 15 * $Scale ; 1. ĐỔ RUỘT MÀU ĐEN (0xFF000000) Global $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000) _GDIPlus_GraphicsFillPolygon($hGraphics, $aPoints, $hBrush) ; 2. VẼ VIỀN MÀU TRẮNG (0xFFFFFFFF) Global $hPen = _GDIPlus_PenCreate(0xFFFFFFFF, 1.5 * $Scale) _GDIPlus_GraphicsDrawPolygon($hGraphics, $aPoints, $hPen) ; --- Dùng DllCall để tránh lỗi thiếu hàm --- Local $tSize = DllStructCreate("long X; long Y") DllStructSetData($tSize, "X", $iW) DllStructSetData($tSize, "Y", $iH) Local $tSource = DllStructCreate("long X; long Y") DllStructSetData($tSource, "X", 0) DllStructSetData($tSource, "Y", 0) Local $tBlend = DllStructCreate("byte BlendOp; byte BlendFlags; byte SourceConstantAlpha; byte AlphaFormat") DllStructSetData($tBlend, "BlendOp", 0) DllStructSetData($tBlend, "BlendFlags", 0) DllStructSetData($tBlend, "SourceConstantAlpha", 255) DllStructSetData($tBlend, "AlphaFormat", 1) ; AC_SRC_ALPHA DllCall("user32.dll", "bool", "UpdateLayeredWindow", _ "hwnd", $hGUI, _ "handle", 0, _ "ptr", 0, _ "ptr", DllStructGetPtr($tSize), _ "handle", $hMemDC, _ "ptr", DllStructGetPtr($tSource), _ "dword", 0, _ "ptr", DllStructGetPtr($tBlend), _ "dword", 2) GUISetState(@SW_SHOWNOACTIVATE) ; ========================================================== ; TỐI ƯU HÓA ĐỘ TRỄ (LOW LATENCY HACK) ; ========================================================== ; 1. Ép xung đồng hồ hệ thống của Windows xuống mức 1 mili-giây (Mặc định là 15.6ms) DllCall("winmm.dll", "uint", "timeBeginPeriod", "uint", 1) Local $aOldPos[2] = [-1, -1] Local $iTimer = TimerInit() While 1 Local $aPos = MouseGetPos() ; Chỉ thực thi lệnh di chuyển khi tọa độ thực sự thay đổi ; If $aPos[0] <> $aOldPos[0] Or $aPos[1] <> $aOldPos[1] Then ; 2. Thay vì dùng WinMove chậm chạp, ta chọc thẳng API SetWindowPos của Windows ; Flags 0x0015 = SWP_NOSIZE (0x0001) | SWP_NOZORDER (0x0004) | SWP_NOACTIVATE (0x0010) DllCall("user32.dll", "bool", "SetWindowPos", _ "hwnd", $hGUI, _ "hwnd", 0, _ "int", $aPos[0], _ "int", $aPos[1], _ "int", 0, _ "int", 0, _ "uint", 0x0015) $aOldPos[0] = $aPos[0] $aOldPos[1] = $aPos[1] ; EndIf If TimerDiff($iTimer) > 2000 Then WinSetOnTop($hGUI, "", 1) $iTimer = TimerInit() EndIf Sleep(1) ; Nhờ timeBeginPeriod, Sleep(1) lúc này sẽ đúng là 1ms thực sự WEnd Func _Exit() ; Trả lại đồng hồ hệ thống về mặc định trước khi thoát để tránh tốn pin/CPU DllCall("winmm.dll", "uint", "timeEndPeriod", "uint", 1) _GDIPlus_BrushDispose($hBrush) _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hGraphics) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteDC($hMemDC) _WinAPI_ReleaseDC($hGUI, $hDC) _GDIPlus_Shutdown() Exit EndFunc