我想获取当前打开的选项卡的名称。
我试过这个:
$currentTabName1 = ControlCommand("Publish This! - Bulk Tools", "", "[CLASS:WindowsForms10.BUTTON.app.0.141b42a_r11_ad1;INSTANCE:16]", "CurrentTab", "")
但这只是让我拒绝。打开的选项卡。
提前致谢
您需要使用 GuiTab.au3 UDF。
这是我的做法。
#RequireAdmin
Opt("WinTitleMatchMode", 4) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase
#include <GuiTab.au3>
$WindowTitle = "[CLASS:SciTEWindow]"
$Control = "[CLASS:SciTeTabCtrl; INSTANCE:1]"
$currentTabName1 = ControlCommand($WindowTitle, "", $Control, "CurrentTab", "")
$hWnd = ControlGetHandle($WindowTitle, "", $Control)
$array = _GUICtrlTab_GetItem ( $hWnd, $currentTabName1-1 ); -1 because we need 0 based
$CurrentTabText = StringTrimLeft($array[1], 1); trimming &
ConsoleWrite($CurrentTabText & @CRLF)
#include <GuiTab.au3>
; $control = yoru control instance name
$iIndex = _GUICtrlTab_GetCurSel($control)
$name = _GUICtrlTab_GetItemText($control, $iIndex)