ioa747 Posted November 20, 2025 Posted November 20, 2025 (edited) SciTE_OverlayTab Highlighting the active & unsaved tab item in SciTE Inspired from 211131-highlighting-the-active-tab-item-in-scite/ (Thanks to BugFix 🏆) While the original was excellent, I found that I needed to change some things. Since I made these adjustments, I decided to share the revised code. What's New New "Significant" Tab Marking: Introduced a new visual layer to mark important tabs. Significant tabs are now highlighted with a 3px Purple top bar for quick identification. Added Ctrl+Shift+6 shortcut to instantly toggle the "Significant" status on the currently focused tab. expandcollapse popup; https://www.autoitscript.com/forum/topic/213330-scite_overlaytab/ ;-------------------------------------------------------------------------------------------------------------------------------- ; Title...........: SciTE_OverlayTab.au3 ; Description.....: Highlighting the active & unsaved tab item in SciTE ; AutoIt Version..: 3.3.18.0 Author: ioa747 Script Version: 0.8 ; Note............: Testet in Windows 11 Pro 24H2 Date:22/03/2026 ; New Layer added (Significant) toggled with Ctrl+Shift+6 ;-------------------------------------------------------------------------------------------------------------------------------- #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <GuiTab.au3> #include <Misc.au3> #include <WinAPISysWin.au3> #include <WindowsStylesConstants.au3> Opt('TrayIconHide', 1) _Singleton(@ScriptName) Global Const $g_hActiveColor = 0x0026FF ; Blue for active Global Const $g_hUnSavedColor = 0xFF6A00 ; Orange for not stored Global Const $g_hSignificantColor = 0x800080 ; Purple for Significant Global Const $g_iOpacity = 50 ; Background transparency Global Const $g_iTopBarHeight = 3 ; Significant line thickness Global $g_aOverlayHwnd[0] Global $g_aSigOverlayHwnd[0] Global $g_mSignificant[] Global $g_SciTE_Handle = WinGetHandle('[CLASS:SciTEWindow]') If Not $g_SciTE_Handle Then Exit HotKeySet("^+6", "_ToggleSignificant") ; <<--( toggled Significant with Ctrl+Shift+6 )--<< OnAutoItExitRegister(_Exit) While WinExists($g_SciTE_Handle) ; Update only if SciTE is visible/active _SciTEState() Sleep(200) WEnd ;--------------------------------------------------------------------------------------- Func _SciTEState() ; Retrieve the state of the SciTEWindow. Local $iState = WinGetState($g_SciTE_Handle) Switch $iState Case 15, 47 ; exists+visible+enabled+active +maximized _UpdateTabOverlays() Case Else Sleep(250) EndSwitch EndFunc ;--------------------------------------------------------------------------------------- Func _UpdateTabOverlays() Local $hTab = _GetHwnd_SciTeTabCtrl() If @error Then Return Local $iCount = _GUICtrlTab_GetItemCount($hTab) Local $iActive = _GUICtrlTab_GetCurFocus($hTab) ; Synchronize tables if the number of Tabs changes If $iCount <> UBound($g_aOverlayHwnd) Then _CleanupOverlays() ReDim $g_aOverlayHwnd[$iCount] ReDim $g_aSigOverlayHwnd[$iCount] EndIf For $i = 0 To $iCount - 1 Local $sRawText = _GUICtrlTab_GetItemText($hTab, $i) Local $sCleanID = _GetCleanTabID($sRawText) Local $tRect = _GUICtrlTab_GetItemRectEx($hTab, $i) ; Active/Unsaved Overlay Local $iBgColor = 0 If $i = $iActive Then $iBgColor = $g_hActiveColor ElseIf StringRight($sRawText, 1) = '*' Then $iBgColor = $g_hUnSavedColor EndIf $g_aOverlayHwnd[$i] = _ManageOverlay($hTab, $tRect, $iBgColor, $g_aOverlayHwnd[$i], False) ; Significant Overlay If MapExists($g_mSignificant, $sCleanID) Then $g_aSigOverlayHwnd[$i] = _ManageOverlay($hTab, $tRect, $g_hSignificantColor, $g_aSigOverlayHwnd[$i], True) Else If IsHWnd($g_aSigOverlayHwnd[$i]) Then _DeleteHandle($g_aSigOverlayHwnd[$i]) EndIf Next EndFunc ;--------------------------------------------------------------------------------------- Func _GetCleanTabID($sText) If StringLeft($sText, 1) = "&" Then $sText = StringTrimLeft($sText, 3) If StringRight($sText, 1) = "*" Then $sText = StringTrimRight($sText, 2) Return $sText EndFunc ;--------------------------------------------------------------------------------------- Func _ToggleSignificant() Local $hTab = _GetHwnd_SciTeTabCtrl() If @error Then Return Local $sID = _GetCleanTabID(_GUICtrlTab_GetItemText($hTab, _GUICtrlTab_GetCurFocus($hTab))) If MapExists($g_mSignificant, $sID) Then MapRemove($g_mSignificant, $sID) Else $g_mSignificant[$sID] = True EndIf EndFunc ;--------------------------------------------------------------------------------------- Func _ManageOverlay($hTab, $tRect, $iColor, $hExisting, $bIsTopBar) If $iColor == 0 Then If IsHWnd($hExisting) Then _DeleteHandle($hExisting) Return 0 EndIf Local $tPoint = DllStructCreate("int X;int Y") DllStructSetData($tPoint, "X", $tRect.Left) DllStructSetData($tPoint, "Y", $tRect.Top) _WinAPI_ClientToScreen($hTab, $tPoint) Local $iX = DllStructGetData($tPoint, "X") Local $iY = DllStructGetData($tPoint, "Y") Local $iW = $tRect.Right - $tRect.Left Local $iH = ($bIsTopBar ? $g_iTopBarHeight : ($tRect.Bottom - $tRect.Top)) Local $hOverlay = $hExisting If Not IsHWnd($hOverlay) Then $hOverlay = GUICreate("", $iW, $iH, $iX, $iY, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_NOACTIVATE, $WS_EX_TRANSPARENT), $hTab) GUISetBkColor($iColor) WinSetTrans($hOverlay, "", ($bIsTopBar ? 150 : $g_iOpacity)) GUISetState(@SW_SHOWNOACTIVATE, $hOverlay) Else WinMove($hOverlay, "", $iX, $iY, $iW, $iH) GUISetBkColor($iColor, $hOverlay) EndIf Return $hOverlay EndFunc ;--------------------------------------------------------------------------------------- Func _DeleteHandle(ByRef $hWnd) GUIDelete($hWnd) $hWnd = 0 EndFunc ;--------------------------------------------------------------------------------------- Func _CleanupOverlays() For $i = 0 To UBound($g_aOverlayHwnd) - 1 _DeleteHandle($g_aOverlayHwnd[$i]) _DeleteHandle($g_aSigOverlayHwnd[$i]) Next EndFunc ;--------------------------------------------------------------------------------------- Func _GetHwnd_SciTeTabCtrl() Local $aChild = _WinAPI_EnumChildWindows($g_SciTE_Handle) If Not @error Then For $i = 1 To $aChild[0][0] If $aChild[$i][1] = "SciTeTabCtrl" Then Return $aChild[$i][0] Next EndIf Return SetError(1, 0, Null) EndFunc ;--------------------------------------------------------------------------------------- Func _Exit() _CleanupOverlays() Exit EndFunc ;--------------------------------------------------------------------------------------- Please, every comment is appreciated! leave your comments and experiences here! Thank you very much Edited Sunday at 12:48 PM by ioa747 Version: 0.8 UEZ, argumentum and donnyh13 3 I know that I know nothing
ioa747 Posted Sunday at 02:15 AM Author Posted Sunday at 02:15 AM (edited) What's New in Version 0.7 New "Significant" Tab Marking: Introduced a new visual layer to mark important tabs. Significant tabs are now highlighted with a 3px Purple top bar for quick identification. Added Ctrl+Shift+6 shortcut to instantly toggle the "Significant" status on the currently focused tab. Update to Version 0.8 I added an extra layer to the site's activity control to reduce processor activity. Edited Sunday at 12:54 PM by ioa747 donnyh13 1 I know that I know nothing
UEZ Posted Sunday at 12:55 PM Posted Sunday at 12:55 PM (edited) I'm getting a crash AutoIt3 ended. rc:-1073740940 when starting it as x64 execution. x86 runs properly. I must add a Sleep(10) to the _ManageOverlay() function. I don't know why but the Tab blue rectangle was topmost painted althouth SciTE was in the background. Just wondering why SciTE doesn't have this feature already onboard... Edited Sunday at 01:02 PM by UEZ ioa747 1 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
ioa747 Posted Sunday at 11:25 PM Author Posted Sunday at 11:25 PM (edited) I prefer to run it on x86, and I didn't encounter any problems. But I also tried it on x64, without Sleep(10), and I didn't encounter any problems here either. (not even with the blue rectangle) Can I ask what version of AutoIt and what version of SciTE you're running? My combination AutoIt Version..: 3.3.18.0 SciTE, 32-bit, Version 4.4.6, Mar 12 2022 10:14:43 Windows 11 Pro, Version 25H2 Edited yesterday at 05:38 AM by ioa747 add AutoIt too I know that I know nothing
UEZ Posted yesterday at 03:28 PM Posted yesterday at 03:28 PM I'm using the x64 version of SciTE -> Version 5.5.8 Scintilla:5.5.8 Lexilla:5.4.6 Jan 12 2026 12:26:07 Autoit: 3.3.18.0 Win: 24H2 ioa747 1 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
bladem2003 Posted yesterday at 03:45 PM Posted yesterday at 03:45 PM (edited) When you call _GUICtrlTab_GetItemText, then _GUICtrlTab_GetItem is called that crashe on x64. The error does not always occur. https://www.autoitscript.com/forum/topic/213108-_guictrltab_getitemtext-the-target-crashes-on-dissimilar-architecture/ Edited yesterday at 03:49 PM by bladem2003 ioa747 1
ioa747 Posted yesterday at 04:30 PM Author Posted yesterday at 04:30 PM I have the impression that this was fixed in Autoit version: 3.3.18.0 I also tried it on x64, and I didn't encounter any problems here either. with AutoIt Version..: 3.3.18.0 SciTE, 64-bit, Version 5.5.8 Windows 11 Pro, Version 25H2 I know that I know nothing
bladem2003 Posted yesterday at 05:21 PM Posted yesterday at 05:21 PM This bug drove me crazy, I couldn't find the error in one of my scripts for a long time. The bug still exists in version 3.3.18.0.
UEZ Posted 39 minutes ago Posted 39 minutes ago (edited) Can somebody test if this works? SciTeTabHook (I create two small DLLs (x86/x64) to hook SciTE which is apparently not possible using Autoit due to Memory Barrier / Local Address limits) It should work with SciTE x86/x64. It is important to run AutoIt on the same architecture as SciTE! Tray icon can be used to close Autoit script. Thx. @ioa747 sorry for hijacking your thread, but this fits in well here. Edited 35 minutes ago by UEZ ioa747 1 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now