#include #include #Include #Include #include ;#include "FastFind.au3" #include #include #RequireAdmin ; ko thong bao khi thieu var co them quyen admin ghi vao bo x32 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "WinHttp.au3" #include "demem.au3" #include #include ;#include "VirtDsktLibrary01.au3" #include #include #include #include #include ; ==================================================================================================== ; CẤU HÌNH KÍCH THƯỚC MẶC ĐỊNH CHO 1 TAB GAME ; ==================================================================================================== Global Const $iTAB_W = 720 Global Const $iTAB_H = 530 ; ==================================================================================================== ; 1. HÀM TẠO LAYER 1 (MASTER GUI KHÔNG VIỀN) ; - $iCols : Số cột muốn xếp ngang (Mặc định 2) ; - $iRows : Số hàng muốn xếp dọc (Mặc định 1) ; - $iPosX, $iPosY: Tọa độ xuất hiện của Layer 1 trên màn hình ; ==================================================================================================== ; 1. Lấy Handle các Game Global $control01 = WinGetHandle("[REGEXPTITLE:\[#\] \["& "a" & "1"&"\] Diablo Immortal \[#\]]") Global $control02 = WinGetHandle("[REGEXPTITLE:\[#\] \["& "a" & "2"&"\] Diablo Immortal \[#\]]") $control00 = WinGetHandle("Diablo Immortal") ; 2. Tạo Layer 1 chứa 2 Cột x 1 Hàng Global $hMyLayer1 = CreateLayer1(2, 1, 50, 50) ; 3. Cấy Tab 1 nằm ở gốc (0, 0), Tab 2 nằm ở sát vách (720, 0) EmbedTabToLayer1($control01, $hMyLayer1, 0, 0) Sleep(100000) Func CreateLayer1($iCols = 2, $iRows = 1, $iPosX = 50, $iPosY = 50) Local $iLayerW = $iTAB_W * $iCols Local $iLayerH = $iTAB_H * $iRows ; Tạo GUI Master $WS_POPUP: Không viền, không title bar AutoIt Local $hLayer1 = GUICreate("Layer_1_Master", $iLayerW, $iLayerH, $iPosX, $iPosY, $WS_POPUP) GUISetState(@SW_SHOW, $hLayer1) Return $hLayer1 EndFunc ; ==================================================================================================== ; 2. HÀM CẤY TAB GAME VÀO TỌA ĐỘ $X, $Y CỤ THỂ TRONG LAYER 1 ; ==================================================================================================== Func EmbedTabToLayer1($hWndTab, $hLayer1, $iX, $iY, $iWidth = $iTAB_W, $iHeight = $iTAB_H) If Not WinExists($hWndTab) Then Return False ; Chuyển Style từ Popup/Standalone sang Cửa sổ Con ($WS_CHILD) Local $iStyle = _WinAPI_GetWindowLong($hWndTab, $GWL_STYLE) ;$iStyle = BitAND($iStyle, BitNOT($WS_POPUP)) ;$iStyle = BitOR($iStyle, $WS_CHILD) _WinAPI_SetWindowLong($hWndTab, $GWL_STYLE, $iStyle) _WinAPI_SetParent($hWndTab, $hLayer1) ; Nhốt vào Layer 1 _WinAPI_MoveWindow($hWndTab, $iX, $iY, $iWidth, $iHeight, True) Return True EndFunc ; ==================================================================================================== ; 3. HÀM CẤY TAB TỰ ĐỘNG THEO STT INDEX (0, 1, 2, 3...) DẠNG MA TRẬN ; Ví dụ: Index 0 -> Cột 0, Hàng 0 | Index 1 -> Cột 1, Hàng 0... ; ==================================================================================================== Func EmbedTabByIndex($hWndTab, $hLayer1, $iIndex, $iMaxCols = 2) Local $iCol = Mod($iIndex, $iMaxCols) ; Tính vị trí Cột Local $iRow = Int($iIndex / $iMaxCols) ; Tính vị trí Hàng Local $iX = $iCol * $iTAB_W Local $iY = $iRow * $iTAB_H Return EmbedTabToLayer1($hWndTab, $hLayer1, $iX, $iY) EndFunc